[cairo] Issue with Font_Face reference count?

Vladimir Vukicevic vladimir at pobox.com
Mon Dec 15 12:56:29 PST 2008


On 12/14/08 11:09 AM, Anne et Damien Carbonne wrote:
> Thanks for rapid answer.
>
> Why is this function called that way (_debug_)? Compliance with previous
> versions?
> If it is only intended for debug purpose, then it means that the
> solution I have used for the binding is wrong :-(
> I attach only one Ada wrapper object for each C object. The Ada wrapper
> is destroyed when the C object is destroyed.

Hm, what do you mean when the C object is destroyed?  The typical way to 
do bindings is to store a pointer to your native object using user_data 
on the surface/font_face/whatever, and use the user_data destructor to 
clean up your wrapper object.  Doing that should avoid any problems when 
refs are kept to the C object outside of your binding's knowledge.  The 
only complexity arises from then needing to do refcounting on your 
wrapper object as well, to know when to release the final cairo ref.

     - Vlad


More information about the cairo mailing list