From 7a9dfa3c40f3324391759a27644880b5395a8ffc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 20 Sep 2003 16:21:35 +0000 Subject: [PATCH] fixed cleanup order to behave correctly in presence of exceptions git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23743 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/app.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/msw/app.cpp b/src/msw/app.cpp index 2b69e91300..a652ec54b7 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -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(); } // ---------------------------------------------------------------------------- -- 2.45.2