From 951118ceb6052cea72e39928bd51dad68227bc3c Mon Sep 17 00:00:00 2001 From: goat Date: Wed, 17 Aug 2022 20:22:21 +0200 Subject: [PATCH] fix: use global for VEH mutex attempts to fix stack overflow when debugging in VS --- Dalamud.Boot/veh.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dalamud.Boot/veh.cpp b/Dalamud.Boot/veh.cpp index bb3f37869..c43c000a5 100644 --- a/Dalamud.Boot/veh.cpp +++ b/Dalamud.Boot/veh.cpp @@ -24,9 +24,12 @@ PVOID g_veh_handle = nullptr; bool g_veh_do_full_dump = false; + HANDLE g_crashhandler_process = nullptr; HANDLE g_crashhandler_pipe_write = nullptr; +std::recursive_mutex g_exception_handler_mutex; + std::chrono::time_point g_time_start; bool is_whitelist_exception(const DWORD code) @@ -126,8 +129,6 @@ static void append_injector_launch_args(std::vector& args) LONG exception_handler(EXCEPTION_POINTERS* ex) { - static std::recursive_mutex s_exception_handler_mutex; - if (ex->ExceptionRecord->ExceptionCode == 0x12345678) { // pass @@ -143,7 +144,7 @@ LONG exception_handler(EXCEPTION_POINTERS* ex) } // block any other exceptions hitting the veh while the messagebox is open - const auto lock = std::lock_guard(s_exception_handler_mutex); + const auto lock = std::lock_guard(g_exception_handler_mutex); exception_info exinfo{}; exinfo.pExceptionPointers = ex;