[cairo] Issue with Font_Face reference count?

Anne et Damien Carbonne aetdcarbonne at free.fr
Sun Dec 14 11:09:27 PST 2008


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.
With other C objects (context, surface, ...) this worked well till now, 
without calling the function you indicated.
Font face is the first one that raised the issue (but as I understand 
it, the issue could have happen with other objects too in the future)
Having to explicitely call such a cleanup function in the end seems 
perfectly acceptable.
The only issue is with this strange name!

Thanks again.

Damien



Chris Wilson a écrit :
> On Sun, 2008-12-14 at 19:09 +0100, Anne et Damien Carbonne wrote:
>   
>> Whilst updating the Ada binding, I found a problem with font face ref 
>> count in the binding.
>> I wrote a small C example that reproduces the issue I have with Ada: 
>> both versions have the same behaviour.
>> So, either I wrongly use cairo, or there is an issue inside cairo.
>>     
>
> This behaviour is entirely expected and is a side-effect of the caching
> cairo performs to maintain a small number of 'holdover' scaled fonts to
> reduce the frequency we need to recreate them and their associated
> glyphs. When investigating memory leaks with cairo, it's advisable to
> clear all of cairo's caches and associated data using
> cairo_debug_reset_static_data() with the caveat being that you guarantee
> that your application does not hold any references to cairo objects
> itself.
>
>   
>>   cairo_surface_destroy (surface);
>>   cairo_font_face_destroy (font_face);
>>   cairo_destroy (context);
>>     
>
> + cairo_debug_reset_static_data ();
>   



More information about the cairo mailing list