[waffle] [PATCH 07/33] linux: plug a memory leak

Emil Velikov emil.l.velikov at gmail.com
Thu Jul 17 06:11:51 PDT 2014


On 17/07/14 04:45, Chad Versace wrote:
> On 07/07/2014 10:28 AM, Emil Velikov wrote:
> 
>> Chad, do you have a plan/idea how to handle this ? I'm assuming that
>> your plan is to tackle this once waffle_init is gone/replaced with a
>> better solution (issue #7).
> 
> There appears to be a straightforward solution: add a new API call
> waffle_finish(void) that tears down the global state set up by
> waffle_init(). The caveat is that if the user makes the calls in this
> sequence:
> 
>   waffle_init(platform=any_egl_platform)
>   ...
>   waffle_finish()
>   ...
>   waffle_init(platform=a_different_egl_platform)
>   BOOM!
> 
> ...then older versions of Mesa crashes inside libEGL. I think the
> issue existed as recent as Mesa 10.0.
> 
Nasty. Did you/someone else manage to track down the fix and have it
back-ported or we are talking about old mesa versions where we don't do stable
releases anymore ?

> Despite the danger of crashing when on buggy drivers, I think adding
> waffle_finish() to the API is a good idea.
> 
> And as you point out, deprecation of waffle_init() will lead to a
> different, but orthogonal solution, to memory leaks.
> 
Ack. Perhaps I'll add waffle_finish at the same time as I break the API while
adding WGL.

-Emil





More information about the waffle mailing list