Clean up on Close
This commit is contained in:
parent
6347287c85
commit
23396a6c6d
1 changed files with 22 additions and 0 deletions
|
|
@ -271,6 +271,28 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
base.OnMouseUp(mouseEvent);
|
||||
}
|
||||
|
||||
public override void OnClosed(EventArgs e)
|
||||
{
|
||||
// If implemented, invoke Dispose on Drawables
|
||||
foreach(var item in drawables)
|
||||
{
|
||||
if (item is IDisposable disposable)
|
||||
{
|
||||
disposable.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var item in itemDrawables)
|
||||
{
|
||||
if (item is IDisposable disposable)
|
||||
{
|
||||
disposable.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
base.OnClosed(e);
|
||||
}
|
||||
|
||||
private bool FindInteractionVolumeHit(Ray ray, out int interactionVolumeHitIndex, out IntersectInfo info)
|
||||
{
|
||||
interactionVolumeHitIndex = -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue