Fix(NetJob): do not call emitAborted() when not running

Signed-off-by: 0x189D7997 <199489335+0x189D7997@users.noreply.github.com>
This commit is contained in:
0x189D7997 2026-04-17 02:56:04 +00:00 committed by GitHub
parent 15b39af92e
commit ffded2ccac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {