From b4b20df751452087c992c04b07a4b05f984acfc1 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 26 Aug 2003 08:18:49 +0000 Subject: [PATCH] Flush log at the beginning of CrashHandler so the log isn't cut off at the tail. Is there a problem with this? I can't think of a reason why fflush would need to allocate memory. --- stepmania/src/archutils/Win32/Crash.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stepmania/src/archutils/Win32/Crash.cpp b/stepmania/src/archutils/Win32/Crash.cpp index b05a626956..54f5a2c7b1 100644 --- a/stepmania/src/archutils/Win32/Crash.cpp +++ b/stepmania/src/archutils/Win32/Crash.cpp @@ -31,7 +31,7 @@ #include "CrashList.h" #include "ProductInfo.h" -#include "RageLog.h" /* for RageLog::GetAdditionalLog only */ +#include "RageLog.h" /* for RageLog::GetAdditionalLog and Flush */ #include "RageThreads.h" /* for GetCheckpointLogs */ #include "GotoURL.h" @@ -276,6 +276,9 @@ static void DoEraseEmergencyDump() extern HWND g_hWndMain; long __stdcall CrashHandler(EXCEPTION_POINTERS *pExc) { + /* Flush the log it isn't cut off at the end. */ + 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 * if the floating point exception for _EM_ZERODIVIDE is unmasked does this