From 19bb2f5bbe6104d00b81b084693c8071626e68b7 Mon Sep 17 00:00:00 2001 From: Gilles Depeyrot Date: Wed, 9 Apr 2003 20:30:33 +0000 Subject: [PATCH] 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/trunk@20114 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/appcmn.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/common/appcmn.cpp b/src/common/appcmn.cpp index e22ebf4a33..25bda2572b 100644 --- a/src/common/appcmn.cpp +++ b/src/common/appcmn.cpp @@ -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 -- 2.47.2