tried to fix the problems reported in bug #126735 fixed again some problem
* python/libxml.py: tried to fix the problems reported in
bug #126735
* xpath.c SAX2.c error.c parser.c valid.c include/libxml/xmlerror.h:
fixed again some problem trying to use the structured error
handlers, c.f. bug #126735
* result/VC/ElementValid: tiny change due to the fix
Daniel
diff --git a/python/libxml.py b/python/libxml.py
index 41103c6..92c4c3c 100644
--- a/python/libxml.py
+++ b/python/libxml.py
@@ -362,21 +362,25 @@
ctxt.xpathFreeContext()
return res
- #
- # Selecting nodes using XPath, faster because the context
- # is allocated just once per xmlDoc.
- #
+# #
+# # Selecting nodes using XPath, faster because the context
+# # is allocated just once per xmlDoc.
+# #
+# # Removed: DV memleaks c.f. #126735
+# #
+# def xpathEval2(self, expr):
+# doc = self.doc
+# if doc == None:
+# return None
+# try:
+# doc._ctxt.setContextNode(self)
+# except:
+# doc._ctxt = doc.xpathNewContext()
+# doc._ctxt.setContextNode(self)
+# res = doc._ctxt.xpathEval(expr)
+# return res
def xpathEval2(self, expr):
- doc = self.doc
- if doc == None:
- return None
- try:
- doc._ctxt.setContextNode(self)
- except:
- doc._ctxt = doc.xpathNewContext()
- doc._ctxt.setContextNode(self)
- res = doc._ctxt.xpathEval(expr)
- return res
+ return self.xpathEval(expr)
# support for python2 iterators
def walk_depth_first(self):
@@ -390,7 +394,7 @@
self.doc._ctxt.xpathFreeContext()
except:
pass
- libxml2mod.freeDoc(self._o)
+ libxml2mod.xmlFreeDoc(self._o)
#