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;
if (doc.LoadFile(fp) != tinyxml2::XML_NO_ERROR)
return false;
return load(doc);
const tinyxml2::XMLError error = doc.LoadFile(fp);
fclose(fp);
return (error != tinyxml2::XML_NO_ERROR) && load(doc);
}
bool Library::load(const tinyxml2::XMLDocument &doc)