From: Jean-Philippe Bruyère Date: Mon, 28 Aug 2017 03:10:21 +0000 (+0200) Subject: test parent type when trying to close window X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=refs%2Fheads%2FIDisposableUnstable;p=jp%2Fcrow.git test parent type when trying to close window --- diff --git a/src/GraphicObjects/Window.cs b/src/GraphicObjects/Window.cs index e0c97ea9..176e8d90 100644 --- a/src/GraphicObjects/Window.cs +++ b/src/GraphicObjects/Window.cs @@ -391,7 +391,12 @@ namespace Crow protected void close(){ Closing.Raise (this, null); - currentInterface.DeleteWidget (this); + if (Parent is Interface) + (Parent as Interface).DeleteWidget (this); + else if (Parent is Group) + (Parent as Group).RemoveChild (this); + else if (Parent is PrivateContainer) + (Parent as Container).Child = null; } } }