]> git.saurik.com Git - wxWidgets.git/commitdiff
fix for wxFrame's last focus bug (finally?)
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 3 Jun 2001 09:43:36 +0000 (09:43 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 3 Jun 2001 09:43:36 +0000 (09:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10415 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/window.cpp

index fb7bb67368e474c987e944d7d281ae4538c7bda2..7b171f9f7cc9c4d11ec8c01ef07129881ab0c8e4 100644 (file)
@@ -297,15 +297,18 @@ wxWindow::~wxWindow()
         {
             if ( frame->GetLastFocus() == this )
                 frame->SetLastFocus((wxWindow*)NULL);
-            //break;
+            break;
         }
     }
 
+    // VS: destroy children first and _then_ detach *this from its parent.
+    //     If we'd do it the other way around, children wouldn't be able
+    //     find their parent frame (see above).
+    DestroyChildren();
+
     if ( m_parent )
         m_parent->RemoveChild(this);
 
-    DestroyChildren();
-
     if ( m_hWnd )
     {
         // VZ: test temp removed to understand what really happens here