aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform/modrinth
diff options
context:
space:
mode:
authorflow <flowlnlnln@gmail.com>2022-06-28 07:09:58 -0300
committerflow <flowlnlnln@gmail.com>2022-07-17 11:33:44 -0300
commit001bbef9eea845ec7b970c73e16d0f129fade18b (patch)
treeae493d22fb1ec15e983cb84e3be6ba47f872781c /launcher/modplatform/modrinth
parentc4316e81e64ad4ac63b0b50106b324a73abdc150 (diff)
downloadPrismLauncher-001bbef9eea845ec7b970c73e16d0f129fade18b.tar.gz
PrismLauncher-001bbef9eea845ec7b970c73e16d0f129fade18b.tar.bz2
PrismLauncher-001bbef9eea845ec7b970c73e16d0f129fade18b.zip
fix: don't use shared_ptr for a background task T_T
Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'launcher/modplatform/modrinth')
-rw-r--r--launcher/modplatform/modrinth/ModrinthAPI.cpp4
-rw-r--r--launcher/modplatform/modrinth/ModrinthAPI.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthAPI.cpp b/launcher/modplatform/modrinth/ModrinthAPI.cpp
index 301c0be8..747cf4c3 100644
--- a/launcher/modplatform/modrinth/ModrinthAPI.cpp
+++ b/launcher/modplatform/modrinth/ModrinthAPI.cpp
@@ -95,14 +95,14 @@ auto ModrinthAPI::latestVersions(const QStringList& hashes,
return netJob;
}
-auto ModrinthAPI::getProjects(QStringList addonIds, QByteArray* response) const -> NetJob::Ptr
+auto ModrinthAPI::getProjects(QStringList addonIds, QByteArray* response) const -> NetJob*
{
auto netJob = new NetJob(QString("Modrinth::GetProjects"), APPLICATION->network());
auto searchUrl = getMultipleModInfoURL(addonIds);
netJob->addNetAction(Net::Download::makeByteArray(QUrl(searchUrl), response));
- QObject::connect(netJob, &NetJob::finished, [response] { delete response; });
+ QObject::connect(netJob, &NetJob::finished, [response, netJob] { delete response; netJob->deleteLater(); });
return netJob;
}
diff --git a/launcher/modplatform/modrinth/ModrinthAPI.h b/launcher/modplatform/modrinth/ModrinthAPI.h
index 2909daf9..e1a18681 100644
--- a/launcher/modplatform/modrinth/ModrinthAPI.h
+++ b/launcher/modplatform/modrinth/ModrinthAPI.h
@@ -47,7 +47,7 @@ class ModrinthAPI : public NetworkModAPI {
ModLoaderTypes loaders,
QByteArray* response) -> NetJob::Ptr;
- auto getProjects(QStringList addonIds, QByteArray* response) const -> NetJob::Ptr override;
+ auto getProjects(QStringList addonIds, QByteArray* response) const -> NetJob* override;
public:
inline auto getAuthorURL(const QString& name) const -> QString { return "https://modrinth.com/user/" + name; };