I use mxml library to parse XML file in C language. I load my XML in buffer using the following code:
mxml_node_t *tree;
tree = mxmlLoadString(NULL,XMLbuf,MXML_OPAQUE_CALLBACK);
The XML file is complicated but this is irrelevant at the moment.
My question is : when I should free memory used by the mxml library functions?
Is it enough to use code like this once and for all:
mxmlDelete(tree);
or I have to repeat that for every node of my XML.(mxmlDelete(node1);mxmlDelete(node2);
until I reach mxmlDelete(tree);
?