diff options
author | Stencel, Joanna <joanna.stencel@intel.com> | 2016-10-24 09:48:11 +0100 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2016-10-24 09:55:02 +0100 |
commit | 19e8270fe0333e1087653c4c1a46ac5052f58670 (patch) | |
tree | 36c55e6569289de2b00df5df2bfdf222417cdc31 /src/egl/drivers | |
parent | cac49ee2cd2998a27c49188101f3f1ba7196fcb5 (diff) | |
download | external_mesa3d-19e8270fe0333e1087653c4c1a46ac5052f58670.zip external_mesa3d-19e8270fe0333e1087653c4c1a46ac5052f58670.tar.gz external_mesa3d-19e8270fe0333e1087653c4c1a46ac5052f58670.tar.bz2 |
egl/wayland: add missing destroy_window callback
The original patch by Joanna added the function pointer and callback yet
things got only partially applied - the infra was added, but the
implementation was missing.
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Fixes: 690ead4a135 ("egl/wayland-egl: Fix for segfault in
dri2_wl_destroy_surface.")
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 2e0ab61e29c4b44d349ab433c899b691a9b12f68)
Diffstat (limited to 'src/egl/drivers')
-rw-r--r-- | src/egl/drivers/dri2/platform_wayland.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index ccab192..789e035 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -118,6 +118,13 @@ resize_callback(struct wl_egl_window *wl_win, void *data) (*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable); } +static void +destroy_window_callback(void *data) +{ + struct dri2_egl_surface *dri2_surf = data; + dri2_surf->wl_win = NULL; +} + /** * Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface(). */ @@ -159,6 +166,7 @@ dri2_wl_create_surface(_EGLDriver *drv, _EGLDisplay *disp, dri2_surf->wl_win->private = dri2_surf; dri2_surf->wl_win->resize_callback = resize_callback; + dri2_surf->wl_win->destroy_window_callback = destroy_window_callback; dri2_surf->base.Width = -1; dri2_surf->base.Height = -1; @@ -254,8 +262,11 @@ dri2_wl_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf) if (dri2_surf->throttle_callback) wl_callback_destroy(dri2_surf->throttle_callback); - dri2_surf->wl_win->private = NULL; - dri2_surf->wl_win->resize_callback = NULL; + if (dri2_surf->wl_win) { + dri2_surf->wl_win->private = NULL; + dri2_surf->wl_win->resize_callback = NULL; + dri2_surf->wl_win->destroy_window_callback = NULL; + } free(surf); |