summaryrefslogtreecommitdiffhomepage
path: root/gui
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-07-20 09:41:51 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-07-20 09:41:51 +0200
commit0ecaa4c888fa316d13afc05b7cd9eb7a0f0ccb5e (patch)
tree98497a134fa7b3b5890a9ecbe08179b7a4306807 /gui
parent9bf7574324ca7db778118b83b8b40d1f8e6df86b (diff)
gui/main: rework forceful exit
- on MSVC, exit before destroying the window. Qt Creator plays nicer with that. - otherwise, don't perform a forceful exit. it seems unnecessary. I'll play with Valgrind some more to verify this.
Diffstat (limited to 'gui')
-rw-r--r--gui/main.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/gui/main.cpp b/gui/main.cpp
index f4cf06af..a70abde2 100644
--- a/gui/main.cpp
+++ b/gui/main.cpp
@@ -185,20 +185,18 @@ main(int argc, char** argv)
app.setQuitOnLastWindowClosed(false);
app.exec();
+ // msvc crashes in Qt plugin system's dtor
+#if defined(_MSC_VER)
+ qDebug() << "exit: terminating";
+ TerminateProcess(GetCurrentProcess(), 0);
+#endif
+
app.exit(0);
qDebug() << "exit: window";
}
while (false);
- // msvc crashes in some destructor
-#if defined(_MSC_VER)
- qDebug() << "exit: terminating";
- TerminateProcess(GetCurrentProcess(), 0);
-#else
- // we have some atexit issues when not leaking bundles
- _exit(0);
-#endif
qDebug() << "exit: main()";
return 0;