From 9488ca42f6ffca81080741fdb8f0bd76bf43a74c Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Sat, 21 Apr 2012 14:12:37 +0000 Subject: [PATCH] Disable deadlocking fatal exception handler in Atlas This was SVN commit r11603. --- source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp b/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp index b996d30972..ff9b5fdb31 100644 --- a/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp +++ b/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp @@ -48,6 +48,11 @@ #include #endif +// If enabled, we'll try to use wxDebugReport to report fatal exceptions. +// But this is broken on Linux and can cause the UI to deadlock (see comment +// in OnFatalException), and it's never especially useful, so don't use it. +#define USE_WX_FATAL_EXCEPTION_REPORT 0 + // Shared memory allocation functions ATLASDLLIMPEXP void* ShareableMalloc(size_t n) { @@ -190,7 +195,7 @@ public: { // _CrtSetBreakAlloc(5632); -#if wxUSE_ON_FATAL_EXCEPTION +#if wxUSE_ON_FATAL_EXCEPTION && USE_WX_FATAL_EXCEPTION_REPORT if (! wxIsDebuggerRunning()) wxHandleFatalExceptions(); #endif @@ -272,9 +277,12 @@ public: return true; } -#if wxUSE_DEBUGREPORT +#if wxUSE_DEBUGREPORT && USE_WX_FATAL_EXCEPTION_REPORT virtual void OnFatalException() { + // NOTE: At least on Linux, this might be called from a thread other + // than the UI thread, so it's not safe to use any wx objects here + wxDebugReport report; wxDebugReportPreviewStd preview;