[Pixman] [BUG REPORT] pixman_glyph_cache_create leaks memory that it allocates

Yuri yuri at rawbw.com
Sun Sep 17 21:25:56 UTC 2017


On 09/17/17 14:08, Emil Velikov wrote:
> I don't think it's pixman's job to hold the user's hand. If the user
> does not clear what it creates, then the user should be fixed. As
> mentioned - pixman emits lovely BUG notations when that happens.

No, I don't see any such BUG messages in my app.


>
>>> All this is obviously orthogonal to the original issue reported;-)
>> I don't see how it is orthogonal.
>>
> What you reported seems like an user error. Although without a proper
> log nobody can tell you for sure.
> The leak I've spotted is a genuine leak in pixman.

Failure to call a destructor in C code could be interpreted as a used 
error, or as a library error. I prefer to call it a library error, 
because it's easier to just destroy it in the library, and not depend on 
users.
In my case, the user is the gtk app created with new Gtk::Main. It 
appears that gtk doesn't destroy the pixman object?


>> There is actually __attribute__((destructor))
>> https://phoxis.org/2011/04/27/c-language-constructors-and-destructors-with-gcc
>> It works with gcc and clang, and probably with most or all other compilers.
>>
> This is precisely what I recommended, haven't I?


Ok then, if you meant this.


Yuri


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pixman/attachments/20170917/9f60c457/attachment.html>


More information about the Pixman mailing list