]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/appbase.cpp
fixing CW 8 builds for all targets
[wxWidgets.git] / src / common / appbase.cpp
index ef32e59f1d8000dc3d1351a7b021412280a12de3..3901c4def1ce8bfbd2f94c4e9ae0583ed3a89641 100644 (file)
@@ -269,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 );
 
@@ -288,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();
@@ -772,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")