[cairo] reference counting vs garbage collection

Carl Worth cworth at cworth.org
Tue Jan 4 20:58:16 PST 2005


On Tue, 04 Jan 2005 20:29:43 -0800, Keith Packard wrote:
> Here's what I think each function should do:
> 
>     _create	allocate object. Refcnt = 1.  Connect dependent objects
>     _ref	refcnt++
>     _unref	if (--refcnt = 0) { finalize dependent objects; free object }
>     _destroy	finalize dependent objects; _unref

Yes. Just what I had in mind.

> and these sequences would always work.

Thanks for confirming this. Keith, do you want to take up the
implementation work (since you've got a binding that wants it).

-Carl



More information about the cairo mailing list