X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14fc7eb426cc05fd3016ad309997bdebcd44dc67..e8f60bac1ab18be00b4e433f5db7b0261c5f17da:/src/cocoa/app.mm diff --git a/src/cocoa/app.mm b/src/cocoa/app.mm index fc253712db..fe12b0f00e 100644 --- a/src/cocoa/app.mm +++ b/src/cocoa/app.mm @@ -64,18 +64,27 @@ wxPoseAsInitializer *wxPoseAsInitializer::sm_first = NULL; { wxASSERT(wxTheApp); wxLogDebug("doIdle called"); - NSRunLoop *rl = [NSRunLoop currentRunLoop]; - // runMode: beforeDate returns YES if something was done - while(wxTheApp->ProcessIdle()) // FIXME: AND NO EVENTS ARE PENDING +#ifdef __WXDEBUG__ + if(wxTheApp->IsInAssert()) { - wxLogDebug("Looping for idle events"); - #if 1 - if( [rl runMode:[rl currentMode] beforeDate:[NSDate distantPast]]) + wxLogDebug("Idle events ignored durring assertion dialog"); + } + else +#endif + { + NSRunLoop *rl = [NSRunLoop currentRunLoop]; + // runMode: beforeDate returns YES if something was done + while(wxTheApp->ProcessIdle()) // FIXME: AND NO EVENTS ARE PENDING { - wxLogDebug("Found actual work to do"); - break; + wxLogDebug("Looping for idle events"); + #if 1 + if( [rl runMode:[rl currentMode] beforeDate:[NSDate distantPast]]) + { + wxLogDebug("Found actual work to do"); + break; + } + #endif } - #endif } wxLogDebug("Idle processing complete, requesting next idle event"); // Add ourself back into the run loop (on next event) if necessary @@ -175,6 +184,10 @@ wxApp::wxApp() #if WXWIN_COMPATIBILITY_2_2 m_wantDebugOutput = TRUE; #endif +#ifdef __WXDEBUG__ + m_isInAssert = FALSE; +#endif // __WXDEBUG__ + argc = 0; argv = NULL; @@ -309,3 +322,12 @@ bool wxApp::Yield(bool onlyIfNeeded) return true; } +#ifdef __WXDEBUG__ +void wxApp::OnAssert(const wxChar *file, int line, const wxChar* cond, const wxChar *msg) +{ + m_isInAssert = TRUE; + wxAppBase::OnAssert(file, line, cond, msg); + m_isInAssert = FALSE; +} +#endif // __WXDEBUG__ +