From cf92fbeb03f8ef4342077bcbc33ee6529d750772 Mon Sep 17 00:00:00 2001 From: Mat Sutcliffe Date: Wed, 24 Oct 2018 22:36:31 +0100 Subject: [PATCH] Worker task wrapper lambda needs to be mutable so its captured task can be moved from properly. --- src/blackmisc/worker.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blackmisc/worker.h b/src/blackmisc/worker.h index abea2166a..b0cf820b9 100644 --- a/src/blackmisc/worker.h +++ b/src/blackmisc/worker.h @@ -224,7 +224,7 @@ namespace BlackMisc static CWorker *fromTask(QObject *owner, const QString &name, F &&task) { int typeId = qMetaTypeId(task)())>>(); - return fromTaskImpl(owner, name, typeId, [task = std::forward(task)]() { return CVariant::fromResultOf(std::move(task)); }); + return fromTaskImpl(owner, name, typeId, [task = std::forward(task)]() mutable { return CVariant::fromResultOf(std::move(task)); }); } //! Connects to a functor to which will be passed the result when the task is finished.