X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b1d4dd7add411ebff1ce4a8d1d992e0e43ee26b1..0b49ccf8d66e2568e2b0de85c25b406aad39f3b1:/src/common/appcmn.cpp diff --git a/src/common/appcmn.cpp b/src/common/appcmn.cpp index 70d6b43e57..25bda2572b 100644 --- a/src/common/appcmn.cpp +++ b/src/common/appcmn.cpp @@ -378,7 +378,6 @@ bool wxAppBase::OnCmdLineParsed(wxCmdLineParser& parser) if ( !theme ) { wxLogError(_("Unsupported theme '%s'."), themeName.c_str()); - return FALSE; } @@ -396,7 +395,6 @@ bool wxAppBase::OnCmdLineParsed(wxCmdLineParser& parser) if ( wxSscanf(modeDesc.c_str(), _T("%ux%u-%u"), &w, &h, &bpp) != 3 ) { wxLogError(_("Invalid display mode specification '%s'."), modeDesc.c_str()); - return FALSE; } @@ -550,6 +548,24 @@ void ShowAssertDialog(const wxChar *szFile, wxStrcat(szBuf, wxT(".")); } +#if wxUSE_THREADS + // if we are not in the main thread, + // output the assert directly and trap since dialogs cannot be displayed + if (!wxThread::IsMain()) { + wxStrcat(szBuf, wxT(" [in child thread]")); +#if defined(__WXMSW__) && !defined(__WXMICROWIN__) + wxStrcat(szBuf, wxT("\r\n")); + OutputDebugString(szBuf); +#else + // send to stderr + wxFprintf(stderr, wxT("%s\n"), szBuf); + fflush(stderr); +#endif + // He-e-e-e-elp!! we're asserting in a child thread + wxTrap(); + } +#endif // wxUSE_THREADS + if ( !s_bNoAsserts ) { // send it to the normal log destination