From 0880d4d37b654ffe68c4497a78883e73933dfe98 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Sat, 15 Jul 2023 09:16:37 +0300 Subject: [PATCH] made sure abort signal is catched in cocurent task Signed-off-by: Trial97 --- launcher/tasks/ConcurrentTask.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/launcher/tasks/ConcurrentTask.cpp b/launcher/tasks/ConcurrentTask.cpp index 7c7cfaf72..7bb02e57d 100644 --- a/launcher/tasks/ConcurrentTask.cpp +++ b/launcher/tasks/ConcurrentTask.cpp @@ -88,6 +88,7 @@ bool ConcurrentTask::abort() QMutableHashIterator doing_iter(m_doing); while (doing_iter.hasNext()) { auto task = doing_iter.next(); + disconnect(task.value().get(), &Task::aborted, this, 0); suceedeed &= (task.value())->abort(); } @@ -133,6 +134,9 @@ void ConcurrentTask::startNext() connect(next.get(), &Task::succeeded, this, [this, next]() { subTaskSucceeded(next); }); connect(next.get(), &Task::failed, this, [this, next](QString msg) { subTaskFailed(next, msg); }); + // this should never happen but if it does better to fail the task that being stuck + // most + connect(next.get(), &Task::aborted, this, [this, next] { subTaskFailed(next, "Aborted"); }); connect(next.get(), &Task::status, this, [this, next](QString msg) { subTaskStatus(next, msg); }); connect(next.get(), &Task::details, this, [this, next](QString msg) { subTaskDetails(next, msg); });