wayland: Destroy frame callback when destroying surface
authorJonas Ådahl <jadahl@gmail.com>
Sat, 27 Oct 2012 22:50:12 +0000 (00:50 +0200)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 8 Nov 2012 18:49:06 +0000 (10:49 -0800)
commit2332bc26d435e465a6f6571ab267db2a33ce05d2
treee4b93adad300c479b2f787eef2d03ca459bad8d6
parentd26890688fc4efdec64e8fef33b54049f9c690bf
wayland: Destroy frame callback when destroying surface

If a frame callback is not destroyed when destroying a surface, its
handler function will be invoked if the surface was destroyed after the
callback was requested but before it was invoked, causing a write on
free:ed memory.

This can happen if eglDestroySurface() is called shortly after
eglSwapBuffers().

Note: This is a candidate for stable branches.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
(cherry picked from commit a3b6b2d3055070da9bf7054fecfd0b171c398eb7)
src/egl/drivers/dri2/platform_wayland.c
src/gallium/state_trackers/egl/wayland/native_wayland.c