X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1bf77ee556a5418059139305e9edb05bde9b8a1d..9a78988fedc6e5364368cd09e60308180d3a7425:/src/msw/app.cpp?ds=sidebyside diff --git a/src/msw/app.cpp b/src/msw/app.cpp index 1176d193a3..a652ec54b7 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -55,17 +55,6 @@ #include "wx/msw/private.h" -#if wxUSE_THREADS - #include "wx/thread.h" - - // define the array of MSG strutures - WX_DECLARE_OBJARRAY(MSG, wxMsgArray); - - #include "wx/arrimpl.cpp" - - WX_DEFINE_OBJARRAY(wxMsgArray); -#endif // wxUSE_THREADS - #if wxUSE_TOOLTIPS #include "wx/tooltip.h" #endif // wxUSE_TOOLTIPS @@ -497,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 @@ -528,8 +523,6 @@ void wxApp::CleanUp() delete wxWinHandleHash; wxWinHandleHash = NULL; - - wxAppBase::CleanUp(); } // ---------------------------------------------------------------------------- @@ -568,22 +561,8 @@ bool wxApp::Initialized() #endif } -// this is a temporary hack and will be replaced by using wxEventLoop in the -// future -// -// it is needed to allow other event loops (currently only one: the modal -// dialog one) to reset the OnIdle() semaphore because otherwise OnIdle() -// wouldn't do anything while a modal dialog shown from OnIdle() call is shown. -bool wxIsInOnIdleFlag = FALSE; - void wxApp::OnIdle(wxIdleEvent& event) { - // Avoid recursion (via ProcessEvent default case) - if ( wxIsInOnIdleFlag ) - return; - - wxIsInOnIdleFlag = TRUE; - wxAppBase::OnIdle(event); #if wxUSE_DC_CACHEING @@ -593,8 +572,6 @@ void wxApp::OnIdle(wxIdleEvent& event) if (!::GetKeyState(MK_LBUTTON) && !::GetKeyState(MK_MBUTTON) && !::GetKeyState(MK_RBUTTON)) wxDC::ClearCache(); #endif // wxUSE_DC_CACHEING - - wxIsInOnIdleFlag = FALSE; } void wxApp::WakeUpIdle()