[Pixman] [BUG REPORT] pixman_glyph_cache_create leaks memory that it allocates
emil.l.velikov at gmail.com
Sun Sep 17 20:07:20 UTC 2017
On 17 September 2017 at 17:46, Yuri <yuri at rawbw.com> wrote:
>> Maybe the right solution is to add explicit pixman_init() and
>> pixman_destroy() functions. But we need to support existing
>> applications too and we can't expect them to start using these
>> new functions without enforcing some changes. That's a kind of
>> historical baggage, and nobody feels like opening this can of
> You can't rely on the apps to always call the right functions. Instead, the
> correct behavior is to uninitialize on exit. What you need to do is to
> schedule uninitialization with atexit call.
> The behavior should be the same as when there is a static C++ object with
> destructor. Such destructor will always be called via atexit, either at the
> end of the application, or when the shared library is unloaded.
Having the opposite - a destructor  should provide symmetry and consistency.
Furthermore using atexit is not as portable/reliable as one would think.
All this is obviously orthogonal to the original issue reported ;-)
More information about the Pixman