diff --git a/native/crash_handler/src/win_crash_generator.cpp b/native/crash_handler/src/win_crash_generator.cpp index 4cb30b2..19b8974 100644 --- a/native/crash_handler/src/win_crash_generator.cpp +++ b/native/crash_handler/src/win_crash_generator.cpp @@ -64,18 +64,20 @@ void create_minidump(struct _EXCEPTION_POINTERS* apExceptionInfo) goto error_handling; } - _MINIDUMP_EXCEPTION_INFORMATION ExInfo{}; - ExInfo.ThreadId = ::GetCurrentThreadId(); - ExInfo.ExceptionPointers = apExceptionInfo; - ExInfo.ClientPointers = FALSE; + { + _MINIDUMP_EXCEPTION_INFORMATION ExInfo{}; + ExInfo.ThreadId = ::GetCurrentThreadId(); + ExInfo.ExceptionPointers = apExceptionInfo; + ExInfo.ClientPointers = FALSE; - if(!pDump(GetCurrentProcess(), GetCurrentProcessId(), hDumpFile, MiniDumpNormal, &ExInfo, nullptr, nullptr)) { - error = "failed to generate dump file"; - goto error_handling; + if(!pDump(GetCurrentProcess(), GetCurrentProcessId(), hDumpFile, MiniDumpNormal, &ExInfo, nullptr, nullptr)) { + error = "failed to generate dump file"; + goto error_handling; + } + ::CloseHandle(hDumpFile); + win_crash_callback(file_path, error, true); + return; } - ::CloseHandle(hDumpFile); - win_crash_callback(file_path, error, true); - return; error_handling: if(hDumpFile) {