fix: don't use shared_ptr for a background task T_T
Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
parent
c4316e81e6
commit
001bbef9ee
7 changed files with 11 additions and 11 deletions
|
@ -124,7 +124,7 @@ auto FlameAPI::getLatestVersion(VersionSearchArgs&& args) -> ModPlatform::Indexe
|
|||
return ver;
|
||||
}
|
||||
|
||||
auto FlameAPI::getProjects(QStringList addonIds, QByteArray* response) const -> NetJob::Ptr
|
||||
auto FlameAPI::getProjects(QStringList addonIds, QByteArray* response) const -> NetJob*
|
||||
{
|
||||
auto* netJob = new NetJob(QString("Flame::GetProjects"), APPLICATION->network());
|
||||
|
||||
|
@ -141,7 +141,7 @@ auto FlameAPI::getProjects(QStringList addonIds, QByteArray* response) const ->
|
|||
|
||||
netJob->addNetAction(Net::Upload::makeByteArray(QString("https://api.curseforge.com/v1/mods"), response, body_raw));
|
||||
|
||||
QObject::connect(netJob, &NetJob::finished, [response] { delete response; });
|
||||
QObject::connect(netJob, &NetJob::finished, [response, netJob] { delete response; netJob->deleteLater(); });
|
||||
QObject::connect(netJob, &NetJob::failed, [body_raw] { qDebug() << body_raw; });
|
||||
|
||||
return netJob;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue