Re: [xml] Support for Python

On Mon, Jan 28, 2002 at 07:59:18PM +0000, Matt Sergeant wrote:
On Mon, 28 Jan 2002, Daniel Veillard wrote:
  I don't think we can have garbage collectable xmlDoc, though nearly
every other classes exposed should be garbageable.

We do this with a proxy object in the Perl interface - the proxy simply
makes sure that the refcount doesn't get lost, and then DESTROY
(equivalent of __del__) does the xmlFree stuff. Works mostly quite well,
though it's a bit tricky to debug.

  Does that mean that each time you export a new object (attribute,
element, etc...) from the interface you inc the ref and dec it each time
one of those is destroyed ?
  The problem is to keep all this coherent in case of more complex operations
like cut an past or if the doc reference from those node disapear. Sounds
tricky to debug all case, I agree. Question, is it worth it ?


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

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