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. 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. _______________________________________________ waffle mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/waffle

