fix(memory leak): don't override default deconstructor + reset shared_ptr + ensure modal get's cleaned up

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers 2023-05-26 21:10:49 -07:00
parent aae892dfd1
commit ff03dd22fe
5 changed files with 3 additions and 7 deletions

View File

@ -41,8 +41,6 @@ class ModPage : public ResourcePage {
return page;
}
~ModPage() override = default;
//: The plural version of 'mod'
[[nodiscard]] inline QString resourcesString() const override { return tr("mods"); }
//: The singular version of 'mods'

View File

@ -230,7 +230,7 @@ void ResourceModel::clearData()
void ResourceModel::runSearchJob(Task::Ptr ptr)
{
m_current_search_job = ptr;
m_current_search_job.reset(ptr); // clean up first
m_current_search_job->start();
}
void ResourceModel::runInfoJob(Task::Ptr ptr)

View File

@ -31,8 +31,6 @@ class ResourcePackResourcePage : public ResourcePage {
return page;
}
~ResourcePackResourcePage() override = default;
//: The plural version of 'resource pack'
[[nodiscard]] inline QString resourcesString() const override { return tr("resource packs"); }
//: The singular version of 'resource packs'

View File

@ -83,6 +83,8 @@ ResourcePage::ResourcePage(ResourceDownloadDialog* parent, BaseInstance& base_in
ResourcePage::~ResourcePage()
{
delete m_ui;
if (m_model)
delete m_model;
}
void ResourcePage::retranslate()

View File

@ -31,8 +31,6 @@ class ShaderPackResourcePage : public ResourcePage {
return page;
}
~ShaderPackResourcePage() override = default;
//: The plural version of 'shader pack'
[[nodiscard]] inline QString resourcesString() const override { return tr("shader packs"); }
//: The singular version of 'shader packs'