From 7be04f19d8bccccdcca1dcf65598fc398411c228 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Fri, 29 Dec 2017 17:51:30 +0100 Subject: [PATCH] Quit own event loop when "shutting down" --- src/blackcore/application.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/blackcore/application.cpp b/src/blackcore/application.cpp index afc08bb63..61b18f5d1 100644 --- a/src/blackcore/application.cpp +++ b/src/blackcore/application.cpp @@ -776,10 +776,11 @@ namespace BlackCore void CApplication::processEventsFor(int milliseconds) { - // sApp check allows to use in test cases without sApp + // sApp check allows to use it in test cases without sApp if (sApp && sApp->isShuttingDown()) { return; } QEventLoop eventLoop; QTimer::singleShot(milliseconds, &eventLoop, &QEventLoop::quit); + connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, &eventLoop, &QEventLoop::quit); eventLoop.exec(); }