mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-30 01:49:10 +00:00
(svn r14164) -Codechange: simplify and unify the addition of ini items with value when not loading an ini file.
-Fix: wrong insertion management causing leaks.
This commit is contained in:
@@ -19,6 +19,14 @@ IniItem::IniItem(IniGroup *parent, const char *name, size_t len) : next(NULL), v
|
||||
parent->last_item = &this->next;
|
||||
}
|
||||
|
||||
IniItem::IniItem(IniGroup *parent, const char *name, const char *value) : next(NULL), comment(NULL)
|
||||
{
|
||||
this->name = strdup(name);
|
||||
this->value = strdup(value);
|
||||
*parent->last_item = this;
|
||||
parent->last_item = &this->next;
|
||||
}
|
||||
|
||||
IniItem::~IniItem()
|
||||
{
|
||||
free(this->name);
|
||||
|
Reference in New Issue
Block a user