diff options
author | flow <flowlnlnln@gmail.com> | 2022-09-16 19:22:37 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2022-09-16 20:12:30 -0300 |
commit | 9e35230467267691ce745429de8d7e0b18095084 (patch) | |
tree | 74c7af42dc551f178fc417306a8a0085980bda2d | |
parent | 1ca2be0039c64f53631a15f72e7c3739cae3e562 (diff) | |
download | PrismLauncher-9e35230467267691ce745429de8d7e0b18095084.tar.gz PrismLauncher-9e35230467267691ce745429de8d7e0b18095084.tar.bz2 PrismLauncher-9e35230467267691ce745429de8d7e0b18095084.zip |
fix: memory leak when getting mods from the mods folder
friendly reminder to always delete your news.
Signed-off-by: flow <flowlnlnln@gmail.com>
-rw-r--r-- | launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp b/launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp index 3a857740..afe892f4 100644 --- a/launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp +++ b/launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp @@ -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; |