1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-08-01 10:06:59 +03:00

- xmlversion.h.in libxml.h: Cygwin patches

- tree.c: xmlFreeNodeList patch similar to xmlFreeNode one
- tree.h: cleanup
Daniel
This commit is contained in:
Daniel Veillard
2001-06-11 08:09:20 +00:00
parent acd370fb1a
commit 9cc6dc62f7
7 changed files with 30 additions and 25 deletions

23
tree.c
View File

@ -2369,11 +2369,30 @@ xmlFreeNodeList(xmlNodePtr cur) {
#else
if (cur->content != NULL) xmlBufferFree(cur->content);
#endif
/*
* When a node is a text node or a comment, it uses a global static
* variable for the name of the node.
*
* The xmlStrEqual comparisons need to be done when (happened with
* XML::libXML and XML::libXSLT) the library is included twice
* statically in the binary and a tree allocated by one occurent
* of the lib gets freed by the other occurence, in this case
* the string addresses compare are not sufficient.
*/
if ((cur->name != NULL) &&
(cur->name != xmlStringText) &&
(cur->name != xmlStringTextNoenc) &&
(cur->name != xmlStringComment))
xmlFree((char *) cur->name);
(cur->name != xmlStringComment)) {
if (cur->type == XML_TEXT_NODE) {
if ((!xmlStrEqual(cur->name, xmlStringText)) &&
(!xmlStrEqual(cur->name, xmlStringTextNoenc)))
xmlFree((char *) cur->name);
} else if (cur->type == XML_COMMENT_NODE) {
if (!xmlStrEqual(cur->name, xmlStringComment))
xmlFree((char *) cur->name);
} else
xmlFree((char *) cur->name);
}
/* TODO : derecursivate this function */
if (cur->nsDef != NULL) xmlFreeNsList(cur->nsDef);
xmlFree(cur);