]> O.S.I.I.S - jp/crow.git/commitdiff
test parent type when trying to close window IDisposableUnstable 34/head
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 28 Aug 2017 03:10:21 +0000 (05:10 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 28 Aug 2017 03:10:21 +0000 (05:10 +0200)
src/GraphicObjects/Window.cs

index e0c97ea99b7b8b0dc0d83038f38c3e58913be6de..176e8d9099db0cafe633039b26cd51b555d484eb 100644 (file)
@@ -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;
                }
        }
 }