clear our data when we parse

This commit is contained in:
Aaron Seigo 2013-02-26 14:45:42 +01:00
parent 4cb892dd04
commit 9be56f7724
2 changed files with 7 additions and 0 deletions

View File

@ -66,6 +66,8 @@ private:
void ConfigLoaderPrivate::parse(ConfigLoader *loader, QIODevice *xml) void ConfigLoaderPrivate::parse(ConfigLoader *loader, QIODevice *xml)
{ {
clearData();
loader->clearItems();
QXmlInputSource source(xml); QXmlInputSource source(xml);
QXmlSimpleReader reader; QXmlSimpleReader reader;
ConfigLoaderHandler handler(loader, this); ConfigLoaderHandler handler(loader, this);

View File

@ -34,6 +34,11 @@ class ConfigLoaderPrivate
} }
~ConfigLoaderPrivate() ~ConfigLoaderPrivate()
{
clearData();
}
void clearData()
{ {
qDeleteAll(bools); qDeleteAll(bools);
qDeleteAll(strings); qDeleteAll(strings);