diff options
author | flow <flowlnlnln@gmail.com> | 2022-08-04 12:57:20 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-04 12:57:20 -0700 |
commit | 75f92de8f8517142289dc76d071cfb4fa724598c (patch) | |
tree | b24f60aafd3a194de86e67a1330c94a3b5daa9e3 /launcher | |
parent | 293c1deee5aae673657205301373b812db4b90f6 (diff) | |
parent | 31ba1de53b2308cdaabda2fa94a7c1a259a8a078 (diff) | |
download | PrismLauncher-75f92de8f8517142289dc76d071cfb4fa724598c.tar.gz PrismLauncher-75f92de8f8517142289dc76d071cfb4fa724598c.tar.bz2 PrismLauncher-75f92de8f8517142289dc76d071cfb4fa724598c.zip |
Merge pull request #1017 from flowln/kill_orphan_metadata
Remove orphaned metadata to avoid problems with auto-updating instances
Diffstat (limited to 'launcher')
-rw-r--r-- | launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp b/launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp index a2e055ba..9b70e7a1 100644 --- a/launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp +++ b/launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp @@ -83,6 +83,17 @@ void ModFolderLoadTask::run() } } + // Remove orphan metadata to prevent issues + // See https://github.com/PolyMC/PolyMC/issues/996 + QMutableMapIterator<QString, Mod::Ptr> iter(m_result->mods); + while (iter.hasNext()) { + auto mod = iter.next().value(); + if (mod->status() == ModStatus::NotInstalled) { + mod->destroy(m_index_dir, false); + iter.remove(); + } + } + emit succeeded(); } |