void XML_free(XMLNode *node)
{
for (int i = 0; i < node->children.size; i++) {
XML_free(node->children.data[i]);
}
free(node->children.data);
XMLNode_free(node);
}
The XMLDocument_free function doesnt really free the XML tree it only frees the root node, I think this frees the entire tree tested with valgrind although relying on recursion is not a good idea an iterative version is more complicated.
The
XMLDocument_freefunction doesnt really free the XML tree it only frees the root node, I think this frees the entire tree tested with valgrind although relying on recursion is not a good idea an iterative version is more complicated.