1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-07-03 06:24:32 +00:00

Fix possible crash when saving animation to non-existing file + loading malformed XML from skin file.

Also fix skeletal cache memory leak.
This commit is contained in:
fgenesis 2014-09-16 00:29:57 +02:00
parent 26dc8560b7
commit 15379db4b8
3 changed files with 16 additions and 9 deletions

View file

@ -547,13 +547,13 @@ tinyxml2::XMLError readXML(const std::string& fn, tinyxml2::XMLDocument& doc)
return err;
}
tinyxml2::XMLDocument *readXML(const std::string& fn, tinyxml2::XMLError *perr /* = 0 */)
tinyxml2::XMLDocument *readXML(const std::string& fn, tinyxml2::XMLError *perr /* = 0 */, bool keepEmpty /* = false */)
{
tinyxml2::XMLDocument *doc = new tinyxml2::XMLDocument();
tinyxml2::XMLError err = readXML(fn, *doc);
if(perr)
*perr = err;
if(err != tinyxml2::XML_SUCCESS)
if(err != tinyxml2::XML_SUCCESS && !keepEmpty)
{
delete doc;
doc = NULL;