From 8a88cfdc7cd45998af4820fa180e389db79c9284 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 5 Sep 2003 19:44:10 +0000 Subject: [PATCH] Must never call LOG->* methods from the crash handler --- stepmania/src/archutils/Win32/Crash.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/stepmania/src/archutils/Win32/Crash.cpp b/stepmania/src/archutils/Win32/Crash.cpp index f08b18f96d..068a6f1963 100644 --- a/stepmania/src/archutils/Win32/Crash.cpp +++ b/stepmania/src/archutils/Win32/Crash.cpp @@ -188,7 +188,14 @@ extern HWND g_hWndMain; long __stdcall CrashHandler(EXCEPTION_POINTERS *pExc) { /* Flush the log it isn't cut off at the end. */ - LOG->Flush(); + /* 1. We can't do regular file access in the crash handler. + * 2. We can't access LOG itself at all, since it may not be set up or the pointer might + * be munged. We must only ever use the RageLog:: methods that access static data, that + * we're being very careful to null-terminate as needed. + * + * Logs are rarely important, anyway. Only info.txt and crashinfo.txt are needed 99% + * of the time. */ +// LOG->Flush(); /* We aren't supposed to receive these exceptions. For example, if you do * a floating point divide by zero, you should receive a result of #INF. Only