diff --git a/src/cocoa/evtloop.mm b/src/cocoa/evtloop.mm index 7981fd26ee..de848b00e3 100644 --- a/src/cocoa/evtloop.mm +++ b/src/cocoa/evtloop.mm @@ -163,7 +163,8 @@ bool wxGUIEventLoop::YieldFor(long eventsToProcess) the main thread waits and then notify the main thread by posting an event. */ - ProcessPendingEvents(); + if (wxTheApp) + wxTheApp->ProcessPendingEvents(); #if wxUSE_LOG // let the logs be flashed again diff --git a/src/msw/evtloop.cpp b/src/msw/evtloop.cpp index d452e18d3a..81276cfaee 100644 --- a/src/msw/evtloop.cpp +++ b/src/msw/evtloop.cpp @@ -503,7 +503,8 @@ bool wxGUIEventLoop::YieldFor(long eventsToProcess) } // if there are pending events, we must process them. - ProcessPendingEvents(); + if (wxTheApp) + wxTheApp->ProcessPendingEvents(); // put back unprocessed events in the queue DWORD id = GetCurrentThreadId();