X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4bbd80984989cfededfc805b941b2cacf5424302..6143d648c866ead1d9330c88359dca8a4f1a654a:/src/os2/app.cpp?ds=sidebyside diff --git a/src/os2/app.cpp b/src/os2/app.cpp index 49d5217b64..097b323973 100644 --- a/src/os2/app.cpp +++ b/src/os2/app.cpp @@ -35,6 +35,7 @@ #include "wx/stdpaths.h" #include "wx/filename.h" +#include "wx/evtloop.h" #include "wx/os2/private.h" @@ -508,9 +509,7 @@ void wxApp::OnQueryEndSession( wxCloseEvent& rEvent ) // bool wxApp::Yield(bool onlyIfNeeded) { - static bool s_inYield = false; - - if ( s_inYield ) + if ( m_isInsideYield ) { if ( !onlyIfNeeded ) { @@ -529,12 +528,13 @@ bool wxApp::Yield(bool onlyIfNeeded) // wxLog::Suspend(); - s_inYield = true; + m_isInsideYield = true; // // We want to go back to the main message loop // if we see a WM_QUIT. (?) // + wxEventLoopGuarantor dummyLoopIfNeeded; while (::WinPeekMsg(vHab, &vMsg, (HWND)NULL, 0, 0, PM_NOREMOVE) && vMsg.msg != WM_QUIT) { #if wxUSE_THREADS @@ -543,6 +543,7 @@ bool wxApp::Yield(bool onlyIfNeeded) if (!wxTheApp->Dispatch()) break; } + // // If they are pending events, we must process them. // @@ -550,11 +551,13 @@ bool wxApp::Yield(bool onlyIfNeeded) wxTheApp->ProcessPendingEvents(); HandleSockets(); + // // Let the logs be flashed again // wxLog::Resume(); - s_inYield = false; + m_isInsideYield = false; + return true; } // end of wxYield