Check in readers "for shutdown"

* myself pattern
* use read as function name
This commit is contained in:
Klaus Basan
2019-02-15 14:17:03 +01:00
committed by Mat Sutcliffe
parent a340167493
commit f2b0417942
3 changed files with 18 additions and 10 deletions

View File

@@ -47,9 +47,12 @@ namespace BlackCore
void CVatsimStatusFileReader::readInBackgroundThread()
{
const bool s = QMetaObject::invokeMethod(this, &CVatsimStatusFileReader::read);
Q_ASSERT_X(s, Q_FUNC_INFO, "Invoke failed");
Q_UNUSED(s);
QPointer<CVatsimStatusFileReader> myself(this);
QTimer::singleShot(0, this, [ = ]
{
if (!myself) { return; }
myself->read();
});
}
CUrlList CVatsimStatusFileReader::getMetarFileUrls() const