Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3924


Ignore:
Timestamp:
06/16/10 11:17:24 (15 years ago)
Author:
mkommend
Message:

added dispose call before removing views from the view collection (ticket #972)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/ViewHost.cs

    r3918 r3924  
    100100        if (viewContextMenuStrip.Items.Count == 0) {
    101101          messageLabel.Visible = true;
    102           viewsLabel.Enabled = false;
     102          viewsLabel.Visible = false;
    103103          viewPanel.Visible = false;
    104104        } else {
    105105          messageLabel.Visible = false;
    106           viewsLabel.Enabled = true;
     106          viewsLabel.Visible = true;
    107107          viewPanel.Visible = true;
    108108        }
     
    117117        } else {
    118118          foreach (Type type in cachedViews.Keys.ToList()) {
    119             if (!ViewCanShowContent(type, Content))
     119            if (!ViewCanShowContent(type, Content)) {
     120              Control c = cachedViews[type] as Control;
     121              if (c != null)
     122                c.Dispose();
    120123              cachedViews.Remove(type);
     124            }
    121125          }
    122126        }
     
    126130      } else {
    127131        messageLabel.Visible = false;
    128         viewsLabel.Enabled = false;
     132        viewsLabel.Visible = false;
    129133        viewPanel.Visible = false;
    130134      }
     
    163167      viewPanel.Controls.Add(control);
    164168      viewPanel.Visible = true;
    165       viewPanel.Refresh();
    166169    }
    167170
Note: See TracChangeset for help on using the changeset viewer.