[libxml2] Namespace nodes can't be unlinked with xmlUnlinkNode
- From: Daniel Veillard <veillard src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Namespace nodes can't be unlinked with xmlUnlinkNode
- Date: Wed, 8 Aug 2012 07:43:34 +0000 (UTC)
commit 6ca24a39d0eb7fd7378a5bc8be3286bf745a36ba
Author: Daniel Veillard <veillard redhat com>
Date: Wed Aug 8 15:31:55 2012 +0800
Namespace nodes can't be unlinked with xmlUnlinkNode
tree.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/tree.c b/tree.c
index 577331e..8169d6d 100644
--- a/tree.c
+++ b/tree.c
@@ -3754,6 +3754,8 @@ xmlFreeNode(xmlNodePtr cur) {
* Unlink a node from it's current context, the node is not freed
* If one need to free the node, use xmlFreeNode() routine after the
* unlink to discard it.
+ * Note that namespace nodes can't be unlinked as they do not have
+ * pointer to their parent.
*/
void
xmlUnlinkNode(xmlNodePtr cur) {
@@ -3764,6 +3766,8 @@ xmlUnlinkNode(xmlNodePtr cur) {
#endif
return;
}
+ if (cur->type == XML_NAMESPACE_DECL)
+ return;
if (cur->type == XML_DTD_NODE) {
xmlDocPtr doc;
doc = cur->doc;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]