Library: Fixed resource leak

This commit is contained in:
Daniel Marjamäki 2013-10-27 17:17:54 +01:00
parent 569a29bc4a
commit e0244d343d
1 changed files with 3 additions and 4 deletions

View File

@ -64,10 +64,9 @@ bool Library::load(const char exename[], const char path[])
} }
tinyxml2::XMLDocument doc; tinyxml2::XMLDocument doc;
if (doc.LoadFile(fp) != tinyxml2::XML_NO_ERROR) const tinyxml2::XMLError error = doc.LoadFile(fp);
return false; fclose(fp);
return (error != tinyxml2::XML_NO_ERROR) && load(doc);
return load(doc);
} }
bool Library::load(const tinyxml2::XMLDocument &doc) bool Library::load(const tinyxml2::XMLDocument &doc)