summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorEran Mizrahi <erasmux@gmail.com>2017-12-11 20:23:42 +0200
committerEran Mizrahi <erasmux@gmail.com>2017-12-11 20:23:42 +0200
commit2c69f9c407ec803c3c99713fe591717ebcee191b (patch)
treec00c69ae53df7393eff22752c5e17aba746e4ba0 /src/main.cpp
parentebb30e0c3731ee4acc86de63c4b32a6be9e4de4f (diff)
call previous unhandled exception filter
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 7f1f199e..eed4dfd3 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -120,20 +120,22 @@ bool bootstrap()
return true;
}
+LPTOP_LEVEL_EXCEPTION_FILTER prevUnhandledExceptionFilter = nullptr;
static LONG WINAPI MyUnhandledExceptionFilter(struct _EXCEPTION_POINTERS *exceptionPtrs)
{
const std::wstring& dumpPath = OrganizerCore::crashDumpsPath();
int dumpRes =
CreateMiniDump(exceptionPtrs, OrganizerCore::getGlobalCrashDumpsType(), dumpPath.c_str());
- if (!dumpRes) {
+ if (!dumpRes)
qCritical("ModOrganizer has crashed, crash dump created.");
- return EXCEPTION_EXECUTE_HANDLER;
- }
- else {
+ else
qCritical("ModOrganizer has crashed, CreateMiniDump failed (%d, error %lu).", dumpRes, GetLastError());
+
+ if (prevUnhandledExceptionFilter)
+ return prevUnhandledExceptionFilter(exceptionPtrs);
+ else
return EXCEPTION_CONTINUE_SEARCH;
- }
}
static bool HaveWriteAccess(const std::wstring &path)
@@ -526,7 +528,7 @@ int runApplication(MOApplication &application, SingleInstance &instance,
int main(int argc, char *argv[])
{
- SetUnhandledExceptionFilter(MyUnhandledExceptionFilter);
+ prevUnhandledExceptionFilter = SetUnhandledExceptionFilter(MyUnhandledExceptionFilter);
MOApplication application(argc, argv);
QStringList arguments = application.arguments();