diff --git a/src/corelib/thread/qfuture_impl.h b/src/corelib/thread/qfuture_impl.h index 088d280e8fe..2f709a56621 100644 --- a/src/corelib/thread/qfuture_impl.h +++ b/src/corelib/thread/qfuture_impl.h @@ -304,9 +304,9 @@ public: : Storage{std::forward(func)}, promise(std::move(p)), parentFuture(f), threadPool(pool), type(Type::Async) { - runObj = QRunnable::create([this] { - this->runFunction(); - delete this; + runObj = QRunnable::create([continuation = this] { + continuation->runFunction(); + delete continuation; }); runObj->setAutoDelete(false); }