X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6c8f8d923aacc5f6f139962375c3930369bc8036..8f9d20d16f54a088aea5fb5e826bf1690efac2ff:/src/common/appbase.cpp diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index 45ce4a4c72..3901c4def1 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -51,6 +51,11 @@ #include "wx/fontmap.h" #endif // wxUSE_FONTMAP +#if defined(__DARWIN__) && defined(_MSL_USING_MW_C_HEADERS) && _MSL_USING_MW_C_HEADERS + // For MacTypes.h for Debugger function + #include +#endif + #if defined(__WXMAC__) // VZ: MacTypes.h is enough under Mac OS X (where I could test it) but // I don't know which headers are needed under earlier systems so @@ -264,6 +269,11 @@ wxMessageOutput *wxAppConsole::CreateMessageOutput() void wxAppConsole::ProcessPendingEvents() { +#if wxUSE_THREADS + if ( !wxPendingEventsLocker ) + return; +#endif + // ensure that we're the only thread to modify the pending events list wxENTER_CRIT_SECT( *wxPendingEventsLocker ); @@ -283,7 +293,9 @@ void wxAppConsole::ProcessPendingEvents() // In ProcessPendingEvents(), new handlers might be add // and we can safely leave the critical section here. wxLEAVE_CRIT_SECT( *wxPendingEventsLocker ); + handler->ProcessPendingEvents(); + wxENTER_CRIT_SECT( *wxPendingEventsLocker ); node = wxPendingEvents->GetFirst(); @@ -582,6 +594,8 @@ void wxTrap() #else SysBreak(); #endif +#elif defined(_MSL_USING_MW_C_HEADERS) && _MSL_USING_MW_C_HEADERS + Debugger(); #elif defined(__UNIX__) raise(SIGTRAP); #else @@ -765,7 +779,19 @@ void ShowAssertDialog(const wxChar *szFile, StackDump dump; dump.Walk(5); // don't show OnAssert() call itself - const wxString& stackTrace = dump.GetStackTrace(); + wxString stackTrace = dump.GetStackTrace(); + + // don't show more than maxLines or we could get a dialog too tall to be + // shown on screen: 20 should be ok everywhere as even with 15 pixel high + // characters it is still only 300 pixels... + const int maxLines = 20; + int count = stackTrace.Freq(wxT('\n')); + if (count > maxLines) + { + int i; + for (i = 0; i < count - maxLines; i++) + stackTrace = stackTrace.BeforeLast(wxT('\n')); + } if ( !stackTrace.empty() ) { msg << _T("\n\nCall stack:\n")