diff --git a/src/blackcore/context/contextaudioimpl.cpp b/src/blackcore/context/contextaudioimpl.cpp index cde8098da..d85f40261 100644 --- a/src/blackcore/context/contextaudioimpl.cpp +++ b/src/blackcore/context/contextaudioimpl.cpp @@ -475,7 +475,7 @@ namespace BlackCore if (ms > 10) { // As of https://dev.swift-project.org/T558 play additional notification - const QPointer myself(const_cast(this)); //! \fixme KB 2019-03 add bit hacky as I need non-const and do not want to change all signatures + const QPointer myself(this); QTimer::singleShot(ms, this, [ = ] { if (!sApp || sApp->isShuttingDown() || !myself) { return; } diff --git a/src/blackgui/components/setuploadingdialog.cpp b/src/blackgui/components/setuploadingdialog.cpp index bdddc927b..20ef3ee82 100644 --- a/src/blackgui/components/setuploadingdialog.cpp +++ b/src/blackgui/components/setuploadingdialog.cpp @@ -84,7 +84,6 @@ namespace BlackGui const CGlobalSetup setup = sApp->getGlobalSetup(); if (setup.wasLoadedFromWeb()) { - QPointer myself(this); QTimer::singleShot(250, this, [ = ] { const CUrlList bootstrapUrls = setup.getSwiftBootstrapFileUrls(); diff --git a/src/blackmisc/worker.cpp b/src/blackmisc/worker.cpp index 0f06569da..2a03223a9 100644 --- a/src/blackmisc/worker.cpp +++ b/src/blackmisc/worker.cpp @@ -200,16 +200,12 @@ namespace BlackMisc if (!CThreadUtils::isCurrentThreadObjectThread(this)) { // shift in correct thread - if (!this->isFinished()) + QPointer myself(this); + QTimer::singleShot(0, this, [ = ] { - QPointer myself(this); - QTimer::singleShot(0, this, [ = ] - { - if (!myself) { return; } - if (this->isFinished()) { return; } - this->startUpdating(updateTimeSecs); - }); - } + if (!myself) { return; } + this->doIfNotFinished([ = ] { startUpdating(updateTimeSecs); }); + }); return; }