mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +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)
|
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; }
|
if (sApp && sApp->isShuttingDown()) { return; }
|
||||||
QEventLoop eventLoop;
|
QEventLoop eventLoop;
|
||||||
QTimer::singleShot(milliseconds, &eventLoop, &QEventLoop::quit);
|
QTimer::singleShot(milliseconds, &eventLoop, &QEventLoop::quit);
|
||||||
|
connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, &eventLoop, &QEventLoop::quit);
|
||||||
eventLoop.exec();
|
eventLoop.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user