From cce1a905f8d798eb689956395daf6161f034ae6f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 7 Jan 2014 17:00:59 +0300 Subject: fix deaddb loading. --- src/resources/db/deaddb.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/resources/db/deaddb.cpp b/src/resources/db/deaddb.cpp index 078813583..870b77394 100644 --- a/src/resources/db/deaddb.cpp +++ b/src/resources/db/deaddb.cpp @@ -37,16 +37,17 @@ namespace void DeadDB::load() { + if (mLoaded) + unload(); + loadXmlFile(paths.getStringValue("deadMessagesFile")); loadXmlFile(paths.getStringValue("deadMessagesPatchFile")); loadXmlDir("deadMessagesPatchDir", loadXmlFile); + mLoaded = true; } void DeadDB::loadXmlFile(const std::string &fileName) { - if (mLoaded) - unload(); - XML::Document *doc = new XML::Document(fileName); const XmlNodePtr root = doc->rootNode(); @@ -78,7 +79,6 @@ void DeadDB::loadXmlFile(const std::string &fileName) } delete doc; - mLoaded = true; } void DeadDB::unload() -- cgit v1.2.3-60-g2f50