X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f0756afed903e7dba726bb4789bf83b760dba31a..fa6416df7f26f0b57afa4f7cbde75dd5d5dcbf27:/src/common/appbase.cpp diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index ef32e59f1d..ee78eb257c 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -772,7 +772,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")