From 20d058acfcce13fa2ce34932d44034fe1a8420dd Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 13 Feb 2025 08:32:17 +0100 Subject: [PATCH] QFutureInterfaceBase::setContinuation(): add a missing std::move() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found by Coverity: We can move the shared_ptr into the last lambda instead of copying it. Amends b0e82f598193f7d2c331a7ff3da7e2d3114db714. Coverity-Id: 474727 Change-Id: If0eb759c97c1e3d1e00aa0ff541ce257a2a2ff69 Reviewed-by: Ivan Solovev Reviewed-by: MÃ¥rten Nordheim --- src/corelib/thread/qfutureinterface.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/thread/qfutureinterface.cpp b/src/corelib/thread/qfutureinterface.cpp index 30d7814ab0a..3a1aae19c33 100644 --- a/src/corelib/thread/qfutureinterface.cpp +++ b/src/corelib/thread/qfutureinterface.cpp @@ -968,7 +968,8 @@ void QFutureInterfaceBase::setContinuation(const QObject *context, std::function // Capture continuationFuture so that it lives as long as the continuation, // and the continuation data remains valid. - setContinuation([watcherMutex, watcher = QPointer(watcher), continuationFuture] + setContinuation([watcherMutex = std::move(watcherMutex), + watcher = QPointer(watcher), continuationFuture] (const QFutureInterfaceBase &parentData) { Q_UNUSED(parentData);