diff options
author | peter1138 <peter1138@openttd.org> | 2009-01-14 20:23:45 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2009-01-14 20:23:45 +0000 |
commit | 7d70f0cd14f55ecc0a273d206aa054165edaf6b9 (patch) | |
tree | cdf9f0d4d99c9240cbc6d417f5fd088ede12fd29 /src/ini.cpp | |
parent | 3cd6bf0ead727d93e1b7850b8a11511603d9c092 (diff) | |
download | openttd-7d70f0cd14f55ecc0a273d206aa054165edaf6b9.tar.xz |
(svn r15085) -Fix (r14164): Clearing a settings group did not delete old items nor reset the last_item pointer, causing lists to not be saved unless they started blank.
Diffstat (limited to 'src/ini.cpp')
-rw-r--r-- | src/ini.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ini.cpp b/src/ini.cpp index dc3f452a5..e8781faab 100644 --- a/src/ini.cpp +++ b/src/ini.cpp @@ -77,6 +77,13 @@ IniItem *IniGroup::GetItem(const char *name, bool create) return new IniItem(this, name, len); } +void IniGroup::Clear() +{ + delete this->item; + this->item = NULL; + this->last_item = &this->item; +} + IniFile::IniFile(const char **list_group_names) : group(NULL), comment(NULL), list_group_names(list_group_names) { this->last_group = &this->group; |