diff --git a/src/blackcore/application.cpp b/src/blackcore/application.cpp index 308abeb4d..fc26c8f2e 100644 --- a/src/blackcore/application.cpp +++ b/src/blackcore/application.cpp @@ -396,6 +396,7 @@ namespace BlackCore bool CApplication::hasWebDataServices() const { + if (this->isShuttingDown()) { return false; } // service will not survive for long return this->m_webDataServices; } diff --git a/src/blackgui/components/cockpitcomcomponent.cpp b/src/blackgui/components/cockpitcomcomponent.cpp index f7d67ddce..ed28cd0f8 100644 --- a/src/blackgui/components/cockpitcomcomponent.cpp +++ b/src/blackgui/components/cockpitcomcomponent.cpp @@ -27,6 +27,7 @@ #include "blackmisc/pq/frequency.h" #include "blackmisc/pq/units.h" #include "blackmisc/sequence.h" +#include "blackmisc/verify.h" #include "ui_cockpitcomcomponent.h" #include @@ -251,13 +252,17 @@ namespace BlackGui CSimulatedAircraft CCockpitComComponent::getOwnAircraft() const { - Q_ASSERT(sGui->getIContextOwnAircraft()); - if (!sGui->getIContextOwnAircraft()) return CSimulatedAircraft(); + // unavailable context during shutdown possible + // mostly when client runs with DBus, but DBus is down + if (!sGui || sGui->isShuttingDown() || !sGui->getIContextOwnAircraft()) { return CSimulatedAircraft(); } return sGui->getIContextOwnAircraft()->getOwnAircraft(); } bool CCockpitComComponent::updateOwnCockpitInContext(const CSimulatedAircraft &ownAircraft) { + // unavailable context during shutdown possible + // mostly when client runs with DBus, but DBus is down + if (!sGui || sGui->isShuttingDown() || !sGui->getIContextOwnAircraft()) { return false; } return sGui->getIContextOwnAircraft()->updateCockpit(ownAircraft.getCom1System(), ownAircraft.getCom2System(), ownAircraft.getTransponder(), identifier()); } diff --git a/src/blackgui/components/dbloadoverviewcomponent.cpp b/src/blackgui/components/dbloadoverviewcomponent.cpp index 12f25cd8b..fad36a8fd 100644 --- a/src/blackgui/components/dbloadoverviewcomponent.cpp +++ b/src/blackgui/components/dbloadoverviewcomponent.cpp @@ -205,6 +205,7 @@ namespace BlackGui { canConnect = CNetworkUtils::canConnect(sharedUrl); allRowsHtml += rowHtml.arg(canConnect ? imgOk : imgFailed, urlLinkHtml.arg(sharedUrl.getFullUrl(), sharedUrl.getHost())); + if (!sGui || sGui->isShuttingDown()) { return; } // shutdown during connect test } ui->lbl_SharedUrls->setText(tableHtml.arg(allRowsHtml.trimmed())); ui->lbl_SharedUrls->setToolTip(sGui->getWebDataServices()->getDbReaderCurrentSharedDbDataUrl().toQString());