fix: Fixed memory leak
Signed-off-by: timoreo <contact@timoreo.fr>
This commit is contained in:
parent
9ff364b0d3
commit
dd6f670dec
@ -238,11 +238,12 @@ bool ModrinthCreationTask::createInstance()
|
|||||||
if (!file.downloads.empty()) {
|
if (!file.downloads.empty()) {
|
||||||
// FIXME: This really needs to be put into a ConcurrentTask of
|
// FIXME: This really needs to be put into a ConcurrentTask of
|
||||||
// MultipleOptionsTask's , once those exist :)
|
// MultipleOptionsTask's , once those exist :)
|
||||||
connect(dl.get(), &NetAction::failed, [this, &file, path, dl] {
|
auto param = dl.toWeakRef();
|
||||||
auto dl = Net::Download::makeFile(file.downloads.dequeue(), path);
|
connect(dl.get(), &NetAction::failed, [this, &file, path, param] {
|
||||||
dl->addValidator(new Net::ChecksumValidator(file.hashAlgorithm, file.hash));
|
auto ndl = Net::Download::makeFile(file.downloads.dequeue(), path);
|
||||||
m_files_job->addNetAction(dl);
|
ndl->addValidator(new Net::ChecksumValidator(file.hashAlgorithm, file.hash));
|
||||||
dl->succeeded();
|
m_files_job->addNetAction(ndl);
|
||||||
|
if (auto shared = param.lock()) shared->succeeded();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user