mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
Make sure SwiftGuiStd::reloadOwnAircraft is not called during shutdown
This commit is contained in:
@@ -34,17 +34,14 @@ using namespace BlackMisc::Audio;
|
||||
|
||||
bool SwiftGuiStd::reloadOwnAircraft()
|
||||
{
|
||||
if (!this->m_contextNetworkAvailable) { return false; }
|
||||
if (!sApp || sApp->isShuttingDown()) { return false; }
|
||||
if (!sApp->getIContextOwnAircraft() || !sApp->getIContextNetwork()) { return false; }
|
||||
|
||||
// check for changed aircraft
|
||||
bool changed = false;
|
||||
CSimulatedAircraft loadedAircraft = sGui->getIContextOwnAircraft()->getOwnAircraft();
|
||||
if (loadedAircraft != m_ownAircraft)
|
||||
{
|
||||
m_ownAircraft = loadedAircraft;
|
||||
changed = true;
|
||||
}
|
||||
return changed;
|
||||
const CSimulatedAircraft contextAircraft = sGui->getIContextOwnAircraft()->getOwnAircraft();
|
||||
if (contextAircraft == m_ownAircraft) { return false; }
|
||||
m_ownAircraft = contextAircraft;
|
||||
return true;
|
||||
}
|
||||
|
||||
void SwiftGuiStd::setTestPosition(const QString &wgsLatitude, const QString &wgsLongitude, const CAltitude &altitude, const CAltitude &pressureAltitude)
|
||||
|
||||
Reference in New Issue
Block a user