diff --git a/src/corelib/thread/qfuture_impl.h b/src/corelib/thread/qfuture_impl.h index 01afa64cd6e..a1c6f9469e1 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); }