Improvements during shutdown

* stop listeners
* check if airspace monitor and FSD still exist
* stop listeners on "aboutToShutdown()"
* check for processEventsFor(500)
This commit is contained in:
Klaus Basan
2020-04-20 20:45:36 +02:00
committed by Mat Sutcliffe
parent 95ca63ce6d
commit 9235f3232e
6 changed files with 139 additions and 38 deletions

View File

@@ -144,8 +144,14 @@ namespace BlackCore
m_validator->deleteLater();
m_validator = nullptr;
}
this->stopSimulatorListeners();
this->disconnect();
this->unloadSimulatorPlugin();
// give listeners a head start
// if simconnect is running remotely it can take a while until it shutdowns
m_listenersThread.quit();
m_listenersThread.wait(10 * 1000);
}
CSimulatorPluginInfoList CContextSimulator::getAvailableSimulatorPlugins() const
@@ -934,7 +940,7 @@ namespace BlackCore
{
if (!m_simulatorPlugin.first.isUnspecified()) { return; }
stopSimulatorListeners();
this->stopSimulatorListeners();
const QStringList enabledSimulators = m_enabledSimulators.getThreadLocal();
const CSimulatorPluginInfoList allSimulators = m_plugins->getAvailableSimulatorPlugins();
for (const CSimulatorPluginInfo &s : allSimulators)