Fix memory handling of xml-nodes in the parser.

This commit is contained in:
Kim Kulling
2020-09-01 21:48:50 +02:00
parent 3c2133a3b9
commit 73fa2cbe88
10 changed files with 86 additions and 406 deletions

View File

@@ -864,8 +864,10 @@ void IRRImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
// Construct the irrXML parser
XmlParser st;
pugi::xml_node *rootElement = st.parse(file.get());
// reader = createIrrXMLReader((IFileReadCallBack*) &st);
if (!st.parse( file.get() )) {
return;
}
pugi::xml_node rootElement = st.getRootNode();
// The root node of the scene
Node *root = new Node(Node::DUMMY);
@@ -897,7 +899,7 @@ void IRRImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
// Parse the XML file
//while (reader->read()) {
for (pugi::xml_node child : rootElement->children())
for (pugi::xml_node child : rootElement.children())
switch (child.type()) {
case pugi::node_element:
if (!ASSIMP_stricmp(child.name(), "node")) {