X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4d3a259aff5b9a699041ca9f126001dfb156223e..eb082a088a77e8afb3c5a87880a42b9ec9a487e3:/src/msw/app.cpp diff --git a/src/msw/app.cpp b/src/msw/app.cpp index be78f82319..ac660f8e3f 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -562,6 +562,8 @@ void wxApp::CleanUp() #if wxUSE_THREADS delete wxPendingEvents; delete wxPendingEventsLocker; + // If we don't do the following, we get an apparent memory leak. + ((wxEvtHandler&) wxDefaultValidator).ClearEventLocker(); #endif wxClassInfo::CleanUpClasses(); @@ -912,11 +914,6 @@ int wxApp::MainLoop() DoMessage(); - - // If they are pending events, we must process them. -#if wxUSE_THREADS - ProcessPendingEvents(); -#endif } return s_currentMsg.wParam; @@ -1022,6 +1019,10 @@ void wxApp::OnIdle(wxIdleEvent& event) event.RequestMore(TRUE); } + // If they are pending events, we must process them. +#if wxUSE_THREADS + ProcessPendingEvents(); +#endif s_inOnIdle = FALSE; } @@ -1177,6 +1178,10 @@ bool wxYield() if ( !wxTheApp->DoMessage() ) break; } + // If they are pending events, we must process them. +#if wxUSE_THREADS + wxTheApp->ProcessPendingEvents(); +#endif return TRUE; }