Avoid issues during shutdown

This commit is contained in:
Klaus Basan
2016-07-13 02:47:00 +02:00
parent 83ff4cb3cf
commit ade581fd50
2 changed files with 4 additions and 0 deletions

View File

@@ -669,6 +669,7 @@ namespace BlackCore
if (this->m_setupReader) if (this->m_setupReader)
{ {
this->m_setupReader->gracefulShutdown(); this->m_setupReader->gracefulShutdown();
this->m_setupReader.reset();
} }
this->m_fileLogger->close(); this->m_fileLogger->close();
@@ -934,6 +935,7 @@ namespace BlackCore
CUrlList CApplication::getVatsimMetarUrls() const CUrlList CApplication::getVatsimMetarUrls() const
{ {
if (this->m_shutdown) { return CUrlList(); }
if (this->m_webDataServices) if (this->m_webDataServices)
{ {
const CUrlList urls(this->m_webDataServices->getVatsimMetarUrls()); const CUrlList urls(this->m_webDataServices->getVatsimMetarUrls());
@@ -948,6 +950,7 @@ namespace BlackCore
CUrlList CApplication::getVatsimDataFileUrls() const CUrlList CApplication::getVatsimDataFileUrls() const
{ {
if (this->m_shutdown) { return CUrlList(); }
if (this->m_webDataServices) if (this->m_webDataServices)
{ {
const CUrlList urls(this->m_webDataServices->getVatsimDataFileUrls()); const CUrlList urls(this->m_webDataServices->getVatsimDataFileUrls());

View File

@@ -79,6 +79,7 @@ namespace BlackCore
void CVatsimMetarReader::readMetars() void CVatsimMetarReader::readMetars()
{ {
if (this->isAbandoned()) { return; }
this->threadAssertCheck(); this->threadAssertCheck();
this->restartTimer(true); // when timer active, restart so we cause no undesired reads this->restartTimer(true); // when timer active, restart so we cause no undesired reads