mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-01 13:48:56 +00:00
Store ini sections in a std::list (rather than vector) to prevent unexpected pointer invalidation with use of GetOrCreateSection.
This commit is contained in:
parent
4138702336
commit
516369594f
2 changed files with 4 additions and 3 deletions
|
@ -233,7 +233,7 @@ IniFile::Section* IniFile::GetOrCreateSection(const std::string& sectionName)
|
|||
if (!section)
|
||||
{
|
||||
sections.push_back(Section(sectionName));
|
||||
section = §ions[sections.size() - 1];
|
||||
section = §ions.back();
|
||||
}
|
||||
return section;
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ bool IniFile::GetLines(const std::string& sectionName, std::vector<std::string>*
|
|||
|
||||
void IniFile::SortSections()
|
||||
{
|
||||
std::sort(sections.begin(), sections.end());
|
||||
sections.sort();
|
||||
}
|
||||
|
||||
bool IniFile::Load(const std::string& filename, bool keep_current_data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue