X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/815b393a5aa2d84cf27562dbf2103180f0c95d4e..245f35816d761212279e8cf223475efb7a367553:/src/common/appcmn.cpp diff --git a/src/common/appcmn.cpp b/src/common/appcmn.cpp index 8090d33ea5..25bda2572b 100644 --- a/src/common/appcmn.cpp +++ b/src/common/appcmn.cpp @@ -212,10 +212,10 @@ void wxAppBase::ProcessPendingEvents() } // iterate until the list becomes empty - wxNode *node = wxPendingEvents->First(); + wxNode *node = wxPendingEvents->GetFirst(); while (node) { - wxEvtHandler *handler = (wxEvtHandler *)node->Data(); + wxEvtHandler *handler = (wxEvtHandler *)node->GetData(); delete node; // In ProcessPendingEvents(), new handlers might be add @@ -224,7 +224,7 @@ void wxAppBase::ProcessPendingEvents() handler->ProcessPendingEvents(); wxENTER_CRIT_SECT( *wxPendingEventsLocker ); - node = wxPendingEvents->First(); + node = wxPendingEvents->GetFirst(); } wxLEAVE_CRIT_SECT( *wxPendingEventsLocker ); @@ -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; } @@ -475,6 +473,7 @@ bool wxAppBase::CheckBuildOptions(const wxBuildOptions& opts) static void LINKAGEMODE SetTraceMasks() { +#if wxUSE_LOG wxString mask; if ( wxGetEnv(wxT("WXTRACE"), &mask) ) { @@ -482,6 +481,7 @@ static void LINKAGEMODE SetTraceMasks() while ( tkn.HasMoreTokens() ) wxLog::AddTraceMask(tkn.GetNextToken()); } +#endif // wxUSE_LOG } // wxASSERT() helper @@ -548,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