Tidying up around QPointer guards.

This commit is contained in:
Mat Sutcliffe
2019-04-29 19:47:05 +01:00
committed by Klaus Basan
parent 3d935485dd
commit 61d933be12
3 changed files with 6 additions and 11 deletions

View File

@@ -200,16 +200,12 @@ namespace BlackMisc
if (!CThreadUtils::isCurrentThreadObjectThread(this))
{
// shift in correct thread
if (!this->isFinished())
QPointer<CContinuousWorker> myself(this);
QTimer::singleShot(0, this, [ = ]
{
QPointer<CContinuousWorker> myself(this);
QTimer::singleShot(0, this, [ = ]
{
if (!myself) { return; }
if (this->isFinished()) { return; }
this->startUpdating(updateTimeSecs);
});
}
if (!myself) { return; }
this->doIfNotFinished([ = ] { startUpdating(updateTimeSecs); });
});
return;
}