X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7bdc18790e34d17edfc02f3e25edcb3425b38a8a..8f974c520a8733158591891458fda10fae4c3950:/src/mgl/evtloop.cpp diff --git a/src/mgl/evtloop.cpp b/src/mgl/evtloop.cpp index 9f8161da68..9e69b980a6 100644 --- a/src/mgl/evtloop.cpp +++ b/src/mgl/evtloop.cpp @@ -157,20 +157,18 @@ bool wxEventLoop::Dispatch() wxCHECK_MSG( IsRunning(), FALSE, _T("can't call Dispatch() if not running") ); event_t evt; - ibool rc = EVT_getNext(&evt, EVT_EVERYEVT); - - if ( !rc ) + ibool rc; + + rc = EVT_getNext(&evt, EVT_EVERYEVT); + while ( !rc ) { - wxLogError(_T("events queue empty even though Pending() returned true")); - return FALSE; + wxUsleep(1000); + if ( !m_impl->GetKeepLooping() ) + return FALSE; + rc = EVT_getNext(&evt, EVT_EVERYEVT); } - - // FIXME_MGL -- there must be some way to programatically exit - // the loop, like WM_QUIT under Windows -- perhaps we need custom - // event to indicate this?? m_impl->ProcessEvent(&evt); return m_impl->GetKeepLooping(); } -