ecere:Window: Fixed nulling out the 'activeChild' member of parent when destroying...
authorJerome St-Louis <jerome@ecere.com>
Mon, 17 Oct 2011 06:12:21 +0000 (02:12 -0400)
committerJerome St-Louis <jerome@ecere.com>
Mon, 17 Oct 2011 06:12:21 +0000 (02:12 -0400)
It seems the parent's active child can still get modified if all windows are not yet created
Window::ActivateEx checks for '!destroyed', but does not check for 'created'
(Adding && !created to that ActivateEx check was an alternative fix, but this fix seemed safer)

ecere/src/gui/Window.ec

index 4431a0e..9def755 100644 (file)
@@ -556,7 +556,13 @@ private:
       ResPtr ptr;
 
       if(parent)
+      {
          stopwatching(parent, font);
+         if(parent.activeChild == this)
+            parent.activeChild = null;
+         if(parent.activeClient == this)
+            parent.activeClient = null;
+      }
 
       if(!destroyed)
       {