summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2020-05-29 16:14:53 +0200
committerglx22 <glx22@users.noreply.github.com>2020-06-01 14:09:58 +0200
commitb5ca2161d93e634f9938af7d9ca1fb1ddab3d501 (patch)
treed8e8361116d9a0e0e1de7800e2dee0107dd9bfad /src
parentf827bc8c1ae83ea4f71347da9c8cb0468f386452 (diff)
downloadopenttd-b5ca2161d93e634f9938af7d9ca1fb1ddab3d501.tar.xz
Fix #7970: [Win32] Disable event loop on crash to prevent recursive faults
Diffstat (limited to 'src')
-rw-r--r--src/os/windows/crashlog_win.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/os/windows/crashlog_win.cpp b/src/os/windows/crashlog_win.cpp
index 9585bdf20..7a1a524aa 100644
--- a/src/os/windows/crashlog_win.cpp
+++ b/src/os/windows/crashlog_win.cpp
@@ -540,6 +540,9 @@ void *_safe_esp = nullptr;
static LONG WINAPI ExceptionHandler(EXCEPTION_POINTERS *ep)
{
+ /* Disable our event loop. */
+ SetWindowLongPtr(GetActiveWindow(), GWLP_WNDPROC, (LONG_PTR)&DefWindowProc);
+
if (CrashLogWindows::current != nullptr) {
CrashLog::AfterCrashLogCleanup();
ExitProcess(2);