summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2020-08-13 14:40:35 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2020-08-13 14:40:35 -0400
commitd69289e081fcd576a5f27ec189f94ea124190f60 (patch)
tree3b0f7c1f5440a8e0abcedb781d79281997254e9b /src
parent592fa7310492392440ee73f4cc0f962c66d5aba7 (diff)
always call the previous terminate handler, which should abort
without it, execution just resumes and dumps are created endlessly
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index f008896b..ed7270bf 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -128,6 +128,7 @@ bool bootstrap()
}
thread_local LPTOP_LEVEL_EXCEPTION_FILTER prevUnhandledExceptionFilter = nullptr;
+thread_local std::terminate_handler prevTerminateHandler = nullptr;
LONG WINAPI MyUnhandledExceptionFilter(struct _EXCEPTION_POINTERS *exceptionPtrs)
{
@@ -158,12 +159,18 @@ void terminateHandler() noexcept
)
{
}
+
+ if (prevTerminateHandler) {
+ prevTerminateHandler();
+ } else {
+ std::abort();
+ }
}
void setUnhandledExceptionHandler()
{
prevUnhandledExceptionFilter = SetUnhandledExceptionFilter(MyUnhandledExceptionFilter);
- std::set_terminate(terminateHandler);
+ prevTerminateHandler = std::set_terminate(terminateHandler);
}
// Parses the first parseArgCount arguments of the current process command line and returns