summaryrefslogtreecommitdiffstats
path: root/common/asyncutils.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/asyncutils.h')
-rw-r--r--common/asyncutils.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/asyncutils.h b/common/asyncutils.h
index 67b5928..c80af30 100644
--- a/common/asyncutils.h
+++ b/common/asyncutils.h
@@ -31,12 +31,12 @@ KAsync::Job<T> run(const std::function<T()> &f, bool runAsync = true)
31 return KAsync::start<T>([f](KAsync::Future<T> &future) { 31 return KAsync::start<T>([f](KAsync::Future<T> &future) {
32 auto result = QtConcurrent::run(f); 32 auto result = QtConcurrent::run(f);
33 auto watcher = new QFutureWatcher<T>; 33 auto watcher = new QFutureWatcher<T>;
34 watcher->setFuture(result);
35 QObject::connect(watcher, &QFutureWatcher<T>::finished, watcher, [&future, watcher]() { 34 QObject::connect(watcher, &QFutureWatcher<T>::finished, watcher, [&future, watcher]() {
36 future.setValue(watcher->future().result()); 35 future.setValue(watcher->future().result());
37 delete watcher; 36 delete watcher;
38 future.setFinished(); 37 future.setFinished();
39 }); 38 });
39 watcher->setFuture(result);
40 }); 40 });
41 } else { 41 } else {
42 return KAsync::start<T>([f]() { 42 return KAsync::start<T>([f]() {