Fix CApplication::processEventsFor so it can be used in samples/unit tests

This commit is contained in:
Klaus Basan
2017-08-14 22:29:32 +02:00
committed by Mathew Sutcliffe
parent 769e3a0e29
commit a993ccd1c1
2 changed files with 5 additions and 4 deletions

View File

@@ -712,7 +712,8 @@ namespace BlackCore
void CApplication::processEventsFor(int milliseconds)
{
if (CApplication::instance()->isShuttingDown()) { return; }
// sApp check allows to use in test cases without sApp
if (sApp && sApp->isShuttingDown()) { return; }
QEventLoop eventLoop;
QTimer::singleShot(milliseconds, &eventLoop, &QEventLoop::quit);
eventLoop.exec();