mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-19 20:25:29 +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()
|
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
|
// check for changed aircraft
|
||||||
bool changed = false;
|
const CSimulatedAircraft contextAircraft = sGui->getIContextOwnAircraft()->getOwnAircraft();
|
||||||
CSimulatedAircraft loadedAircraft = sGui->getIContextOwnAircraft()->getOwnAircraft();
|
if (contextAircraft == m_ownAircraft) { return false; }
|
||||||
if (loadedAircraft != m_ownAircraft)
|
m_ownAircraft = contextAircraft;
|
||||||
{
|
return true;
|
||||||
m_ownAircraft = loadedAircraft;
|
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
return changed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SwiftGuiStd::setTestPosition(const QString &wgsLatitude, const QString &wgsLongitude, const CAltitude &altitude, const CAltitude &pressureAltitude)
|
void SwiftGuiStd::setTestPosition(const QString &wgsLatitude, const QString &wgsLongitude, const CAltitude &altitude, const CAltitude &pressureAltitude)
|
||||||
|
|||||||
Reference in New Issue
Block a user