From ade581fd50cf20fe67961e3b8936c011e64c28e1 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Wed, 13 Jul 2016 02:47:00 +0200 Subject: [PATCH] Avoid issues during shutdown --- src/blackcore/application.cpp | 3 +++ src/blackcore/vatsim/vatsimmetarreader.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/src/blackcore/application.cpp b/src/blackcore/application.cpp index adb0a1451..ee014c8d6 100644 --- a/src/blackcore/application.cpp +++ b/src/blackcore/application.cpp @@ -669,6 +669,7 @@ namespace BlackCore if (this->m_setupReader) { this->m_setupReader->gracefulShutdown(); + this->m_setupReader.reset(); } this->m_fileLogger->close(); @@ -934,6 +935,7 @@ namespace BlackCore CUrlList CApplication::getVatsimMetarUrls() const { + if (this->m_shutdown) { return CUrlList(); } if (this->m_webDataServices) { const CUrlList urls(this->m_webDataServices->getVatsimMetarUrls()); @@ -948,6 +950,7 @@ namespace BlackCore CUrlList CApplication::getVatsimDataFileUrls() const { + if (this->m_shutdown) { return CUrlList(); } if (this->m_webDataServices) { const CUrlList urls(this->m_webDataServices->getVatsimDataFileUrls()); diff --git a/src/blackcore/vatsim/vatsimmetarreader.cpp b/src/blackcore/vatsim/vatsimmetarreader.cpp index 0359c6f00..3e62a3691 100644 --- a/src/blackcore/vatsim/vatsimmetarreader.cpp +++ b/src/blackcore/vatsim/vatsimmetarreader.cpp @@ -79,6 +79,7 @@ namespace BlackCore void CVatsimMetarReader::readMetars() { + if (this->isAbandoned()) { return; } this->threadAssertCheck(); this->restartTimer(true); // when timer active, restart so we cause no undesired reads