refs #270 don't call CRuntime::gracefulShutdown from a different thread;

connect it to the QCoreApplication::aboutToQuit signal instead
This commit is contained in:
Mathew Sutcliffe
2014-06-19 22:10:50 +01:00
parent 42d8c53290
commit fede3fc4c7
3 changed files with 3 additions and 2 deletions

View File

@@ -154,7 +154,6 @@ namespace BlackMiscTest
else if (line.startsWith("all")) runtime->slotLog(enable);
}
}
runtime->gracefulShutdown();
QCoreApplication::quit();
}
} // namespace

View File

@@ -305,6 +305,8 @@ namespace BlackCore
BlackSim::registerMetadata();
BlackCore::registerMetadata();
this->connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, this, &CRuntime::gracefulShutdown);
// upfront reading of settings, as DBus server already relies on settings
CContextSettings *settings = nullptr;
QString dbusAddress;

View File

@@ -139,7 +139,7 @@ namespace BlackCore
//! Slot logging for bool value from a specific context
void logSlot(LogContext ctx, const char *func, bool boolValue) const;
//! shutdown
//! Clean up (will be connected to signal QCoreApplication::aboutToQuit)
void gracefulShutdown();
// ------- Context as interface, normal way to access a context