mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-23 13:55:36 +08:00
Avoid crash during shutdown
This commit is contained in:
committed by
Mat Sutcliffe
parent
e5e6c53c82
commit
48da5da393
@@ -1137,13 +1137,12 @@ namespace BlackCore
|
|||||||
this->reverseLookupAndUpdateOwnAircraftModel(model);
|
this->reverseLookupAndUpdateOwnAircraftModel(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ISimulator::reverseLookupAndUpdateOwnAircraftModel(const BlackMisc::Simulation::CAircraftModel &model)
|
void ISimulator::reverseLookupAndUpdateOwnAircraftModel(const CAircraftModel &model)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(sApp, Q_FUNC_INFO, "Missing sApp");
|
|
||||||
Q_ASSERT_X(sApp->hasWebDataServices(), Q_FUNC_INFO, "Missing web services");
|
|
||||||
|
|
||||||
if (!model.hasModelString()) { return; }
|
if (!model.hasModelString()) { return; }
|
||||||
if (this->isShuttingDown()) { return; }
|
if (this->isShuttingDown()) { return; }
|
||||||
|
Q_ASSERT_X(sApp->hasWebDataServices(), Q_FUNC_INFO, "Missing web services");
|
||||||
|
|
||||||
if (this->getOwnAircraftModel() != model)
|
if (this->getOwnAircraftModel() != model)
|
||||||
{
|
{
|
||||||
if (CDatabaseUtils::hasDbAircraftData())
|
if (CDatabaseUtils::hasDbAircraftData())
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CInfoBarStatusComponent::onSimulatorStatusChanged(int status)
|
void CInfoBarStatusComponent::onSimulatorStatusChanged(int status)
|
||||||
{
|
{
|
||||||
|
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||||
const ISimulator::SimulatorStatus simStatus = static_cast<ISimulator::SimulatorStatus>(status);
|
const ISimulator::SimulatorStatus simStatus = static_cast<ISimulator::SimulatorStatus>(status);
|
||||||
if (simStatus.testFlag(ISimulator::Connected))
|
if (simStatus.testFlag(ISimulator::Connected))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user