From 0ecaa4c888fa316d13afc05b7cd9eb7a0f0ccb5e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 20 Jul 2017 09:41:51 +0200 Subject: 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. --- gui/main.cpp | 14 ++++++-------- 1 file 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; -- cgit v1.2.3