[xml] Curious Segmentation Fault



This python program has a segmentation fault:

import libxml2
libxml2.debugMemory(1)
doc = libxml2.newDoc("1.0")
element = doc.newChild(None, "test", None)
element.unlinkNode()
doc.freeDoc()
element.freeNode()

This is fine:

import libxml2
libxml2.debugMemory(1)
doc = libxml2.newDoc("1.0")
element = doc.newChild(None, "test", None)
element.unlinkNode()
element.freeNode()
doc.freeDoc()

This is fine too:

import libxml2
libxml2.debugMemory(1)
doc = libxml2.newDoc("1.0")
element = doc.newChild(None, "test", None)
element.unlinkNode()
doc.freeDoc()
doc = libxml2.newDoc("1.0")
doc.addChild(element)
element.unlinkNode()
element.freeNode()
doc.freeDoc()

Why?

-- 
Anthony Carrico



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]