From 92ad1b9c4db65c4b5ff5879063a071a637e9930c Mon Sep 17 00:00:00 2001 From: Jussi Virtanen Date: Sat, 1 Apr 2017 17:52:25 +0300 Subject: [PATCH] Use pointers inside ini loop to retain references to ini files --- Source/Core/Core/GeckoCodeConfig.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/GeckoCodeConfig.cpp b/Source/Core/Core/GeckoCodeConfig.cpp index 8cae3d8b68..541537f3a4 100644 --- a/Source/Core/Core/GeckoCodeConfig.cpp +++ b/Source/Core/Core/GeckoCodeConfig.cpp @@ -17,10 +17,10 @@ std::vector LoadCodes(const IniFile& globalIni, const IniFile& localI { std::vector gcodes; - for (const IniFile& ini : {globalIni, localIni}) + for (const IniFile* ini : {&globalIni, &localIni}) { std::vector lines; - ini.GetLines("Gecko", &lines, false); + ini->GetLines("Gecko", &lines, false); GeckoCode gcode; @@ -42,7 +42,7 @@ std::vector LoadCodes(const IniFile& globalIni, const IniFile& localI gcodes.push_back(gcode); gcode = GeckoCode(); gcode.enabled = (1 == ss.tellg()); // silly - gcode.user_defined = (&ini == &localIni); + gcode.user_defined = (ini == &localIni); ss.seekg(1, std::ios_base::cur); // read the code name std::getline(ss, gcode.name, '['); // stop at [ character (beginning of contributor name) @@ -75,7 +75,7 @@ std::vector LoadCodes(const IniFile& globalIni, const IniFile& localI gcodes.push_back(gcode); } - ini.GetLines("Gecko_Enabled", &lines, false); + ini->GetLines("Gecko_Enabled", &lines, false); for (const std::string& line : lines) {