aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennyMcLennington <lenny@sneed.church>2022-07-25 06:57:40 +0100
committerGitHub <noreply@github.com>2022-07-25 06:57:40 +0100
commit65a945f968459786bc235d37bf1302d03ccd07d6 (patch)
tree0fe04e93f443a0ba398513873315026fe725b9d1
parent0e473f4570f49ba212459365c7971b5d3988a3ff (diff)
parent1157436a24cc219295512bbcf6b14f590969510d (diff)
downloadPrismLauncher-65a945f968459786bc235d37bf1302d03ccd07d6.tar.gz
PrismLauncher-65a945f968459786bc235d37bf1302d03ccd07d6.tar.bz2
PrismLauncher-65a945f968459786bc235d37bf1302d03ccd07d6.zip
Merge pull request #956 from flowln/jar_mods_aa
Fix segmentation fault when using jar mods
-rw-r--r--launcher/MMCZip.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/launcher/MMCZip.cpp b/launcher/MMCZip.cpp
index 1627ee07..8518e606 100644
--- a/launcher/MMCZip.cpp
+++ b/launcher/MMCZip.cpp
@@ -141,9 +141,10 @@ bool MMCZip::createModdedJar(QString sourceJarPath, QString targetJarPath, const
QSet<QString> addedFiles;
// Modify the jar
- for (auto i = mods.constEnd(); i != mods.constBegin(); --i)
+ // This needs to be done in reverse-order to ensure we respect the loading order of components
+ for (auto i = mods.crbegin(); i != mods.crend(); i++)
{
- const Mod* mod = *i;
+ const auto* mod = *i;
// do not merge disabled mods.
if (!mod->enabled())
continue;