mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
Quit own event loop when "shutting down"
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user