This commit is contained in:
Glenn Maynard
2004-01-14 22:18:27 +00:00
parent d516f94332
commit e40c819dc2
+12 -7
View File
@@ -153,15 +153,18 @@ long __stdcall CrashHandler(EXCEPTION_POINTERS *pExc)
RageThread::HaltAllThreads( false ); RageThread::HaltAllThreads( false );
static bool InHere = false; static int InHere = 0;
if(InHere) if( InHere > 0 )
{ {
/* If we get here, then we've been called recursively, which means /* If we get here, then we've been called recursively, which means we crashed.
* we crashed. * If InHere is greater than 1, then we crashed after writing the crash dump;
*/ * say so. */
SetUnhandledExceptionFilter(NULL); SetUnhandledExceptionFilter(NULL);
MessageBox( NULL, MessageBox( NULL,
"The error reporting interface has crashed.\n", InHere == 1?
"The error reporting interface has crashed.\n":
"The error reporting interface has crashed. However, crashinfo.txt was"
"written successfully to the program directory.\n",
"Fatal Error", MB_OK ); "Fatal Error", MB_OK );
#ifdef DEBUG #ifdef DEBUG
DebugBreak(); DebugBreak();
@@ -169,7 +172,7 @@ long __stdcall CrashHandler(EXCEPTION_POINTERS *pExc)
return EXCEPTION_EXECUTE_HANDLER; return EXCEPTION_EXECUTE_HANDLER;
} }
InHere=true; ++InHere;
///////////////////////// /////////////////////////
hFontMono = CreateFont( hFontMono = CreateFont(
@@ -202,6 +205,8 @@ long __stdcall CrashHandler(EXCEPTION_POINTERS *pExc)
* dump, save it now. */ * dump, save it now. */
DoSave(pExc); DoSave(pExc);
++InHere;
/* Now things get more risky. If we're fullscreen, the window will obscure the /* Now things get more risky. If we're fullscreen, the window will obscure the
* crash dialog. Try to hide the window. We stopped threads above; we need to * crash dialog. Try to hide the window. We stopped threads above; we need to
* resume them now, or ShowWindow will deadlock. Things might blow up here; * resume them now, or ShowWindow will deadlock. Things might blow up here;