Fix race condition between previous and next weather request

Once a weather request was finished, its worker gets destroyed automatically
but not immediately. This can cause it to still exist, when the next
request is being processed.
Therefore wait with sending the fetchingFinished() signal, until the
worker is fully destroyed.

ref T235
This commit is contained in:
Roland Winklmeier
2018-02-03 16:09:59 +01:00
committed by Klaus Basan
parent 597f3f7a6a
commit 0c7d2b23f4

View File

@@ -98,7 +98,9 @@ namespace BlackWxPlugin
void CWeatherDataGfs::fetchingWeatherDataFinished()
{
emit fetchingFinished();
// If the worker is not destroyed yet, try again in 10 ms.
if (m_parseGribFileWorker) { QTimer::singleShot(10, this, &CWeatherDataGfs::fetchingWeatherDataFinished); }
else { emit fetchingFinished(); }
}
void CWeatherDataGfs::parseGfsFile(QNetworkReply *nwReplyPtr)