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

Emil Velikov emil.l.velikov at gmail.com
Sun Sep 17 21:08:33 UTC 2017


Yuri, please don't use HTML emails. It completely messes up the quotation.

On 17 September 2017 at 21:17, Yuri <yuri at rawbw.com> wrote:
> On 09/17/17 13:07, Emil Velikov wrote:
>
>> Having the opposite - a destructor [1] should provide symmetry and
>> consistency.
>> Furthermore using atexit is not as portable/reliable as one would think.
>>
>
> It should be the destructor that handles this. Either the user clears it, or
> destructor clears it.
>
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.

>> 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.

>
> 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?

-Emil


More information about the Pixman mailing list