Ref T730, context shutdown

* virtual function for "about to shutdown"
* graceful shutdown
This commit is contained in:
Klaus Basan
2019-10-07 17:46:55 +02:00
committed by Mat Sutcliffe
parent 857e3581b0
commit f69edff5c0
6 changed files with 42 additions and 10 deletions

View File

@@ -7,6 +7,7 @@
*/
#include "blackcore/context/context.h"
#include "blackcore/application.h"
#include "blackmisc/logcategorylist.h"
using namespace BlackMisc;
@@ -21,6 +22,15 @@ namespace BlackCore
return cats;
}
IContext::IContext(CCoreFacadeConfig::ContextMode mode, QObject *parent) :
QObject(parent), m_mode(mode), m_contextId(QDateTime::currentMSecsSinceEpoch())
{
if (sApp && !sApp->isShuttingDown())
{
QObject::connect(sApp, &CApplication::aboutToShutdown, this, &IContext::onAboutToShutdown);
}
}
IContextNetwork *IContext::getIContextNetwork()
{
return this->getRuntime()->getIContextNetwork();