Release references and propagate Close to non-children widgets

This commit is contained in:
John Lewin 2018-11-15 14:36:24 -08:00
parent 59a16f53b5
commit 9463311bf2
4 changed files with 38 additions and 1 deletions

View file

@ -120,6 +120,19 @@ namespace MatterHackers.MatterControl.CustomWidgets
this.Rebuild();
}
public override void OnClosed(EventArgs e)
{
// Iterate and close all held tab widgets
foreach (var item in allTabs)
{
item.widget.Close();
}
allTabs.Clear();
base.OnClosed(e);
}
public override void Initialize()
{
base.Initialize();
@ -172,7 +185,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
nameWidget.widget.ClearRemovedFlag();
}
this.RemoveAllChildren();
this.CloseAllChildren();
SimpleTabs tabControl = null;