]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed cleanup order to behave correctly in presence of exceptions
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 20 Sep 2003 16:21:35 +0000 (16:21 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 20 Sep 2003 16:21:35 +0000 (16:21 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23743 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/app.cpp

index 2b69e913004dfc9dd2431da74cb3505cca1f3dcf..a652ec54b77bcf13492d6cb0c7d939c480da91bd 100644 (file)
@@ -486,6 +486,12 @@ bool wxApp::UnregisterWindowClasses()
 
 void wxApp::CleanUp()
 {
+    // all objects pending for deletion must be deleted first, otherwise we
+    // would crash when they use wxWinHandleHash (and UnregisterWindowClasses()
+    // call wouldn't succeed as long as any windows still exist), so call the
+    // base class method first and only then do our clean up
+    wxAppBase::CleanUp();
+
 #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
     wxSetKeyboardHook(FALSE);
 #endif
@@ -517,8 +523,6 @@ void wxApp::CleanUp()
 
     delete wxWinHandleHash;
     wxWinHandleHash = NULL;
-
-    wxAppBase::CleanUp();
 }
 
 // ----------------------------------------------------------------------------