summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2/platform_wayland.c
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2012-10-28 00:50:12 +0200
committerKristian Høgsberg <krh@bitplanet.net>2012-11-07 16:13:03 -0500
commita3b6b2d3055070da9bf7054fecfd0b171c398eb7 (patch)
tree4064e9278000438ef021e22183bd121452ca050a /src/egl/drivers/dri2/platform_wayland.c
parent0b61f0b14894792baa48d59ff3df167334c7d83e (diff)
downloadexternal_mesa3d-a3b6b2d3055070da9bf7054fecfd0b171c398eb7.zip
external_mesa3d-a3b6b2d3055070da9bf7054fecfd0b171c398eb7.tar.gz
external_mesa3d-a3b6b2d3055070da9bf7054fecfd0b171c398eb7.tar.bz2
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>
Diffstat (limited to 'src/egl/drivers/dri2/platform_wayland.c')
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index 9153ef9..772116a 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -213,6 +213,9 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
dri2_surf->third_buffer);
}
+ if (dri2_surf->frame_callback)
+ wl_callback_destroy(dri2_surf->frame_callback);
+
free(surf);
return EGL_TRUE;