fix: memory leak when getting mods from the mods folder

friendly reminder to always delete your news.

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow 2022-09-16 19:22:37 -03:00
parent 1ca2be0039
commit 9e35230467
No known key found for this signature in database
GPG Key ID: 8D0F221F0A59F469

View File

@ -57,6 +57,8 @@ void ModFolderLoadTask::executeTask()
if (mod->enabled()) {
if (m_result->mods.contains(mod->internal_id())) {
m_result->mods[mod->internal_id()]->setStatus(ModStatus::Installed);
// Delete the object we just created, since a valid one is already in the mods list.
delete mod;
}
else {
m_result->mods[mod->internal_id()] = mod;