fix: crash when task was canceled and abort signal was fired early (#3712)
This commit is contained in:
commit
36d18b393b
4 changed files with 7 additions and 6 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue