Re: [gdome]reference counts and freeDoc (fwd)



On Fri, 15 Jun 2001, Paolo Casarini wrote:
> want to talk about this in the mailing list so we can try to find the best  
> solution, I try to make 3 possible solution:
> 1- gdome_di_freeDoc also free the reference to the GdomeDocument object
> passed as argument.
> 2- gdome_doc_unref also free the document structure when its refcnt reach
> 0.
> 3- gdome_di_freeDoc also free all the reference that point to the Document
> specified (For this I've to save a pointer to all active references).

How about that (modified 2.): All existing node objects also increase the
reference count of the doc object, and unref it on destruction. When doc's
refcount reaches zero, free the document. This way, doc is guaranteed to
be the last node alive, and when it dies, the libxml tree should go with
it.

Stupid me, could not think of that yesterday. This would also have been
easier in the wrapper.

greetings, Tobias






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