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

@@ -139,9 +139,10 @@ void IRRMeshImporter::InternReadFile(const std::string &pFile,
// Construct the irrXML parser
XmlParser parser;
pugi::xml_node *root = parser.parse(file.get());
/*CIrrXML_IOStreamReader st(file.get());
reader = createIrrXMLReader((IFileReadCallBack*) &st);*/
if (!parser.parse( file.get() )) {
return;
}
XmlNode root = parser.getRootNode();
// final data
std::vector<aiMaterial *> materials;
@@ -164,7 +165,7 @@ void IRRMeshImporter::InternReadFile(const std::string &pFile,
bool useColors = false;
// Parse the XML file
for (pugi::xml_node child : root->children()) {
for (pugi::xml_node child : root.children()) {
if (child.type() == pugi::node_element) {
if (!ASSIMP_stricmp(child.name(), "buffer") && (curMat || curMesh)) {
// end of previous buffer. A material and a mesh should be there