summaryrefslogtreecommitdiff
path: root/win32.c
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2005-01-15 16:38:10 +0000
committerdarkvater <darkvater@openttd.org>2005-01-15 16:38:10 +0000
commit732c362deaaa9b6a817a2e82c45d88e33f8f1e90 (patch)
tree07ffc7b8b01005a5dcc5636c3c4b6ce24aabf934 /win32.c
parentef3b9161f8f106a7cf6b02766fac06d92523816a (diff)
downloadopenttd-732c362deaaa9b6a817a2e82c45d88e33f8f1e90.tar.xz
(svn r1524) -"Feature": when windows exception tracker is enabled (release builds) and the game crashes for any reason any active log file is closed first. This ensures the log file and ingame debug messages can be used to debug a problem. Any *nix versions are welcome
Diffstat (limited to 'win32.c')
-rw-r--r--win32.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/win32.c b/win32.c
index bb83fed72..1a8bbb324 100644
--- a/win32.c
+++ b/win32.c
@@ -1337,6 +1337,8 @@ static void Handler2()
DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(100), NULL, CrashDialogFunc);
}
+extern bool CloseConsoleLogIfActive();
+
static LONG WINAPI ExceptionHandler(EXCEPTION_POINTERS *ep)
{
char *output;
@@ -1442,13 +1444,17 @@ static LONG WINAPI ExceptionHandler(EXCEPTION_POINTERS *ep)
}
}
+ /* Close any possible log files */
+ CloseConsoleLogIfActive();
+
if (_safe_esp) {
ep->ContextRecord->Eip = (DWORD)Handler2;
ep->ContextRecord->Esp = (DWORD)_safe_esp;
return EXCEPTION_CONTINUE_EXECUTION;
- } else {
- return EXCEPTION_EXECUTE_HANDLER;
}
+
+
+ return EXCEPTION_EXECUTE_HANDLER;
}
static void Win32InitializeExceptions()