diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 6105be515e2..08c0f2fc39b 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -685,17 +685,11 @@ void QmakeBuildSystem::asyncUpdate() m_asyncUpdateFutureInterface->reportStarted(); const auto watcher = new QFutureWatcher(this); - connect(watcher, &QFutureWatcher::canceled, this, [this, watcher] { - if (!m_qmakeGlobals) - return; - m_qmakeGlobals->killProcesses(); - watcher->disconnect(); - watcher->deleteLater(); - }); - connect(watcher, &QFutureWatcher::finished, this, [watcher] { - watcher->disconnect(); - watcher->deleteLater(); + connect(watcher, &QFutureWatcher::canceled, this, [this] { + if (m_qmakeGlobals) + m_qmakeGlobals->killProcesses(); }); + connect(watcher, &QFutureWatcher::finished, watcher, &QObject::deleteLater); watcher->setFuture(m_asyncUpdateFutureInterface->future()); const Kit *const k = kit();