diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-08-13 14:42:19 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-13 14:42:19 -0400 |
| commit | 41249036e5d9d96c42a358d19d025b6542b0b3a8 (patch) | |
| tree | 7dcc22fe1e690e2e5dab21c0642abf9853719d5d /src/main.cpp | |
| parent | 0adf8a9f1b5d088d7eaa476d93164669b97128db (diff) | |
| parent | d69289e081fcd576a5f27ec189f94ea124190f60 (diff) | |
Merge pull request #1194 from isanae/die-after-dump
Die after dumping
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 9 |
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 |
