mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 01:29:50 +00:00
Clear modsToInstall earlier
Dataflow is now more clear. The `std::vector` is cleared earlyer, so there is a bit less memory used.
This commit is contained in:
+2
-4
@@ -658,7 +658,8 @@ static void RunGameOrAtlas(const PS::span<const char* const> argv)
|
||||
CModInstaller installer(paths.UserData() / "mods", paths.Cache());
|
||||
|
||||
// Install the mods without deleting the pyromod files
|
||||
for (const OsPath& modPath : modsToInstall)
|
||||
// `modsToInstall` is cleared so we don't intstall the mods again on restart.
|
||||
for (const OsPath& modPath : std::exchange(modsToInstall, {}))
|
||||
{
|
||||
CModInstaller::ModInstallationResult result = installer.Install(modPath, g_ScriptContext, true);
|
||||
if (result != CModInstaller::ModInstallationResult::SUCCESS)
|
||||
@@ -701,9 +702,6 @@ static void RunGameOrAtlas(const PS::span<const char* const> argv)
|
||||
NonVisualFrame();
|
||||
}
|
||||
|
||||
// Do not install mods again in case of restart (typically from the mod selector)
|
||||
modsToInstall.clear();
|
||||
|
||||
ShutdownNetworkAndUI();
|
||||
guiScriptInterface.reset();
|
||||
ShutdownConfigAndSubsequent();
|
||||
|
||||
Reference in New Issue
Block a user