]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/appcmn.cpp
implemented fallback for AlphaBlend() for the systems not supporting it
[wxWidgets.git] / src / common / appcmn.cpp
index e22ebf4a3395befa5e3716b9ec0c7cbb847dc1e2..25bda2572b28e387b86e76ed21dd6975ba0d7071 100644 (file)
@@ -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