Re: [xml] Python bindings: per parser context error handlers

On Tue, Jan 14, 2003 at 06:08:03AM -0500, Daniel Veillard wrote:
On Tue, Jan 14, 2003 at 10:47:28AM +0100, Stéphane Bidoul wrote:
  It applies cleanly, it looks sound overall, but it generate memory

  Actually, the more I look at it the less I agree with the code.
libxml_xmlParserCtxtPtrWrap() allocate an empty xmlParserCtxtPyCtxt
each time the parser context reference is passed back to the Python
level. Plus it doesn't not even check if ctxt->_private existed or
not. I think that's wrong.
  The ctxt->_private should be set *only* when the Python routine
for associating private handlers to the context is called after checking
that such a block doesn't exist already. I see no reason why 
libxml_xmlParserCtxtPtrWrap() should be modified.
   I fixed this, integrated in the python/tests regressions
resulting in the enclosed patch, which was then commited to CVS



Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

Attachment: patch
Description: Text document

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