Changed shutdown order in facade

* audio first, with disconnect
* then network

rational: logoff from the network first
This commit is contained in:
Klaus Basan
2020-03-30 20:27:10 +02:00
committed by Mat Sutcliffe
parent 507c9e57d7
commit 53ed37d7fd

View File

@@ -315,17 +315,14 @@ namespace BlackCore
if (m_dbusServer) { m_dbusServer->removeAllObjects(); } if (m_dbusServer) { m_dbusServer->removeAllObjects(); }
// handle contexts // handle contexts
if (this->getIContextSimulator())
if (this->getCContextAudioBase())
{ {
disconnect(this->getIContextSimulator()); // there is no empty audio context since AFV
if (this->getIContextSimulator()->isUsingImplementingObject()) disconnect(this->getCContextAudioBase());
{ this->getCContextAudioBase()->gracefulShutdown();
// shutdown the plugins this->getIContextAudio()->deleteLater();
this->getCContextSimulator()->gracefulShutdown(); m_contextAudio = nullptr;
}
this->getIContextSimulator()->deleteLater();
QDBusConnection defaultConnection("default");
m_contextSimulator = IContextSimulator::create(this, CCoreFacadeConfig::NotUsed, nullptr, defaultConnection);
} }
// log off from network, if connected // log off from network, if connected
@@ -343,13 +340,17 @@ namespace BlackCore
m_contextNetwork = IContextNetwork::create(this, CCoreFacadeConfig::NotUsed, nullptr, defaultConnection); m_contextNetwork = IContextNetwork::create(this, CCoreFacadeConfig::NotUsed, nullptr, defaultConnection);
} }
if (this->getCContextAudioBase()) if (this->getIContextSimulator())
{ {
// there is no empty audio context since AFV disconnect(this->getIContextSimulator());
disconnect(this->getCContextAudioBase()); if (this->getIContextSimulator()->isUsingImplementingObject())
this->getCContextAudioBase()->gracefulShutdown(); {
this->getIContextAudio()->deleteLater(); // shutdown the plugins
m_contextAudio = nullptr; this->getCContextSimulator()->gracefulShutdown();
}
this->getIContextSimulator()->deleteLater();
QDBusConnection defaultConnection("default");
m_contextSimulator = IContextSimulator::create(this, CCoreFacadeConfig::NotUsed, nullptr, defaultConnection);
} }
if (this->getIContextOwnAircraft()) if (this->getIContextOwnAircraft())