mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 09:59:59 +03:00
Merge pull request #1200 from Trial97/net_job_crash
Made ByteSynkArray to use shared_ptr
This commit is contained in:
parent
9df3c5d3c0
commit
05056e1abf
47 changed files with 659 additions and 793 deletions
|
|
@ -53,12 +53,11 @@ void ModrinthCheckUpdate::executeTask()
|
|||
// (though it will rarely happen, if at all)
|
||||
if (mod->metadata()->hash_format != best_hash_type) {
|
||||
auto hash_task = Hashing::createModrinthHasher(mod->fileinfo().absoluteFilePath());
|
||||
connect(hash_task.get(), &Task::succeeded, [&] {
|
||||
QString hash(hash_task->getResult());
|
||||
connect(hash_task.get(), &Hashing::Hasher::resultsReady, [&hashes, &mappings, mod](QString hash) {
|
||||
hashes.append(hash);
|
||||
mappings.insert(hash, mod);
|
||||
});
|
||||
connect(hash_task.get(), &Task::failed, [this, hash_task] { failed("Failed to generate hash"); });
|
||||
connect(hash_task.get(), &Task::failed, [this] { failed("Failed to generate hash"); });
|
||||
hashing_task.addTask(hash_task);
|
||||
} else {
|
||||
hashes.append(hash);
|
||||
|
|
@ -71,7 +70,7 @@ void ModrinthCheckUpdate::executeTask()
|
|||
hashing_task.start();
|
||||
loop.exec();
|
||||
|
||||
auto* response = new QByteArray();
|
||||
auto response = std::make_shared<QByteArray>();
|
||||
auto job = api.latestVersions(hashes, best_hash_type, m_game_versions, m_loaders, response);
|
||||
|
||||
QEventLoop lock;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue