fix: crash when task was canceled and abort signal was fired early (#3712)

This commit is contained in:
Alexandru Ionut Tripon
2025-04-30 10:10:36 +03:00
committed by GitHub
4 changed files with 7 additions and 6 deletions

View File

@ -63,7 +63,6 @@ bool ModrinthPackExportTask::abort()
{
if (task) {
task->abort();
emitAborted();
return true;
}
return false;
@ -158,6 +157,7 @@ void ModrinthPackExportTask::makeApiRequest()
task = api.currentVersions(pendingHashes.values(), "sha512", response);
connect(task.get(), &Task::succeeded, [this, response]() { parseApiResponse(response); });
connect(task.get(), &Task::failed, this, &ModrinthPackExportTask::emitFailed);
connect(task.get(), &Task::aborted, this, &ModrinthPackExportTask::emitAborted);
task->start();
}
}