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:
parent
1ca2be0039
commit
9e35230467
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user