mirror of
https://github.com/electronicarts/CNC_TS_and_RA2_Mission_Editor.git
synced 2025-07-22 15:14:52 -04:00
fixed bug that INI group might already been destroyed while iterating the group
This commit is contained in:
parent
f1b969219a
commit
48c9065537
2 changed files with 15 additions and 4 deletions
|
@ -103,12 +103,17 @@ public:
|
|||
const CString& m_section;
|
||||
};
|
||||
|
||||
IniSectionGroup(const IniFileGroup& source, const CString& secName) :
|
||||
m_source(source),
|
||||
IniSectionGroup(IniFileGroup&& source, const CString& secName) :
|
||||
m_source(std::move(source)),
|
||||
m_section(secName)
|
||||
{
|
||||
}
|
||||
|
||||
IniSectionGroup(const IniFileGroup& source, const CString& secName) :
|
||||
IniSectionGroup(IniFileGroup(source), secName)
|
||||
{
|
||||
}
|
||||
|
||||
Iterator begin() const {
|
||||
auto groupBeg = m_source.begin();
|
||||
auto [secItBeg, secItEnd] = acquireNextKvGroup(groupBeg);
|
||||
|
@ -146,6 +151,6 @@ private:
|
|||
return acquireNextKvGroup(m_section, beg, m_source.end());
|
||||
}
|
||||
|
||||
const IniFileGroup& m_source;
|
||||
const IniFileGroup m_source;
|
||||
CString m_section;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue