if we are not in the main thread, output the assert directly and trap since
dialogs cannot be displayed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20116 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -549,6 +549,24 @@ void ShowAssertDialog(const wxChar *szFile,
|
|||||||
wxStrcat(szBuf, wxT("."));
|
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 )
|
if ( !s_bNoAsserts )
|
||||||
{
|
{
|
||||||
// send it to the normal log destination
|
// send it to the normal log destination
|
||||||
|
Reference in New Issue
Block a user