summaryrefslogtreecommitdiff
path: root/src/ini.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2009-01-14 20:23:45 +0000
committerpeter1138 <peter1138@openttd.org>2009-01-14 20:23:45 +0000
commitc4c32692dfd65d6535e98e7d9660f4403059553c (patch)
treecdf9f0d4d99c9240cbc6d417f5fd088ede12fd29 /src/ini.cpp
parent61093eb2115bf22ca7e417af4e9048f60d2b47af (diff)
downloadopenttd-c4c32692dfd65d6535e98e7d9660f4403059553c.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.cpp7
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;