From 7d70f0cd14f55ecc0a273d206aa054165edaf6b9 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Wed, 14 Jan 2009 20:23:45 +0000 Subject: (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. --- src/ini.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/ini.cpp') 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; -- cgit v1.2.3-54-g00ecf