X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/48733d474148267a7e1008b2bd019451d632ce17..9d1b7527cd9713a521912045a3bd2bddbc31d841:/src/msw/app.cpp diff --git a/src/msw/app.cpp b/src/msw/app.cpp index e071002e1b..6a18714bf7 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -25,6 +25,7 @@ #endif #ifndef WX_PRECOMP + #include "wx/dynarray.h" #include "wx/frame.h" #include "wx/app.h" #include "wx/utils.h" @@ -38,9 +39,7 @@ #include "wx/dialog.h" #include "wx/msgdlg.h" #include "wx/intl.h" - #include "wx/dynarray.h" #include "wx/wxchar.h" - #include "wx/icon.h" #include "wx/log.h" #endif @@ -48,6 +47,7 @@ #include "wx/filename.h" #include "wx/module.h" #include "wx/dynlib.h" +#include "wx/evtloop.h" #include "wx/msw/private.h" #include "wx/msw/ole/oleutils.h" @@ -109,8 +109,6 @@ // global variables // --------------------------------------------------------------------------- -extern wxList WXDLLEXPORT wxPendingDelete; - #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) extern void wxSetKeyboardHook(bool doIt); #endif @@ -218,7 +216,14 @@ bool wxGUIAppTraits::DoMessageFromThreadWait() { // we should return false only if the app should exit, i.e. only if // Dispatch() determines that the main event loop should terminate - return !wxTheApp || wxTheApp->Dispatch(); + wxEventLoop *evtLoop = wxEventLoop::GetActive(); + if ( !evtLoop || !evtLoop->Pending() ) + { + // no events means no quit event + return true; + } + + return evtLoop->Dispatch(); } wxToolkitInfo& wxGUIAppTraits::GetToolkitInfo() @@ -305,7 +310,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv) // fails to find a device. SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX); #endif - + wxOleInitialize(); RegisterWindowClasses(); @@ -583,7 +588,7 @@ int wxApp::GetComCtl32Version() // we're prepared to handle the errors wxLogNull noLog; - + #if wxUSE_DYNLIB_CLASS // do we have it? wxDynamicLibrary dllComCtl32(_T("comctl32.dll"), wxDL_VERBATIM); @@ -642,7 +647,7 @@ int wxApp::GetComCtl32Version() } } } -#endif +#endif } return s_verComCtl32; @@ -748,8 +753,6 @@ terminate the program,\r\n\ #if WXWIN_COMPATIBILITY_2_4 -#include "wx/evtloop.h" - void wxApp::DoMessage(WXMSG *pMsg) { wxEventLoop *evtLoop = wxEventLoop::GetActive();