diff --git a/launcher/InstanceCreationTask.cpp b/launcher/InstanceCreationTask.cpp index ecc9fe591..7e74a9336 100644 --- a/launcher/InstanceCreationTask.cpp +++ b/launcher/InstanceCreationTask.cpp @@ -18,7 +18,7 @@ bool InstanceCreationTask::abort() return m_gameFilesTask->abort(); } - return true; + return InstanceTask::abort(); } void InstanceCreationTask::executeTask() diff --git a/launcher/net/NetJob.cpp b/launcher/net/NetJob.cpp index dae149ab3..03705900c 100644 --- a/launcher/net/NetJob.cpp +++ b/launcher/net/NetJob.cpp @@ -100,13 +100,18 @@ auto NetJob::canAbort() const -> bool auto NetJob::abort() -> bool { - bool fullyAborted = true; - // fail all downloads on the queue for (auto task : m_queue) m_failed.insert(task.get(), task); m_queue.clear(); + if (m_doing.isEmpty()) { + // no downloads to abort, NetJob is not running + return true; + } + + bool fullyAborted = true; + // abort active downloads auto toKill = m_doing.values(); for (auto part : toKill) { diff --git a/launcher/tasks/Task.h b/launcher/tasks/Task.h index 6591ca302..38c09da90 100644 --- a/launcher/tasks/Task.h +++ b/launcher/tasks/Task.h @@ -165,7 +165,7 @@ class Task : public QObject, public QRunnable { //! used by external code to ask the task to abort virtual bool abort() { - if (canAbort()) + if (canAbort() && isRunning()) emitAborted(); return canAbort(); }