[cairo] memory leak in _cairo_pattern_create_solid

BJörn Lindqvist bjourne at gmail.com
Tue Oct 16 12:39:20 PDT 2007


On 10/16/07, Carl Worth <cworth at cworth.org> wrote:
> On Tue, 16 Oct 2007 12:27:33 -0400, Behdad Esfahbod wrote:
> > Because there's not much point in doing that other than slowing down
> > application shutdown.  And of course it's not portable and all...
> >
> > Though now that you bring it up, I don't mind marking
> > cairo_debug_reset_static_data() with __attribute__ ((destructor)).
> > Carl, objections?
>
> In general, I agree with your point that this will just slow down
> application shutdown.

Have you profiled it? I can't imagine the function takes more than 1 ms or so.

> But there's another issue which is that unconditionally calling
> cairo_debug_reset_static_data will emit error messages unless the
> application has first carefully cleaned up everything, (not holding an
> references to cached data).

Isn't it that that is the core of the problem? A finalizer should of
course not try to free something that something else references.


-- 
mvh Björn


More information about the cairo mailing list