]> git.saurik.com Git - wxWidgets.git/commitdiff
1. removed code that already exist in ~wxTLWBase from ~wxTLW
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 10 Dec 2006 15:58:18 +0000 (15:58 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 10 Dec 2006 15:58:18 +0000 (15:58 +0000)
2. reordered TLW destruction so that the TLW is fully usable until all children (that could possibly use it from their dtors) are destroyed

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43902 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/dfb/toplevel.cpp

index 5c042f3358a574ca434c80eb8c68f077927f7aed..b5dcc161da77a086deecb8685b937c54f01b2e3c 100644 (file)
@@ -176,16 +176,11 @@ wxTopLevelWindowDFB::~wxTopLevelWindowDFB()
 {
     m_isBeingDeleted = true;
 
-    wxTopLevelWindows.DeleteObject(this);
-
-    if ( wxTheApp->GetTopWindow() == this )
-        wxTheApp->SetTopWindow(NULL);
-
-    if ( wxTopLevelWindows.empty() && wxTheApp->GetExitOnFrameDelete() )
-    {
-        wxTheApp->ExitMainLoop();
-    }
+    // destroy all children before we destroy the underlying DirectFB window,
+    // so that if any of them does something with the TLW, it will still work:
+    DestroyChildren();
 
+    // it's safe to delete the underlying DirectFB window now:
     wxDELETE(m_toPaint);
 
     if ( !m_dfbwin )