Quit own event loop when "shutting down"

This commit is contained in:
Klaus Basan
2017-12-29 17:51:30 +01:00
parent 75202eb4ce
commit 7be04f19d8

View File

@@ -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();
}