summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Velikov <emil.velikov@collabora.com>2017-08-27 11:20:27 +0100
committerAndres Gomez <agomez@igalia.com>2017-09-06 18:05:10 +0300
commit618c883b8ec99162c02f1eba6796b281f987afc2 (patch)
tree98b630ca091a37dae88f4af4bc874559cf907900
parent52e70819b4302d06dbfc3fd3dd655e79aefba7c8 (diff)
egl/wayland: plug leaks in dri2_wl_create_window_surface() error path
We forgot to teardown the wl display/surface wrappers. Fixes: 03dd9a88b0b ("egl/wayland: Use per-surface event queues") Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> (cherry picked from commit 83442112d7136b6d0c2f6d84c409c04664aeb154)
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index e5a867b6f02..a65338eb9c4 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -174,7 +174,7 @@ dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
dri2_surf->wl_surface_wrapper = wl_proxy_create_wrapper(window->surface);
if (!dri2_surf->wl_surface_wrapper) {
_eglError(EGL_BAD_ALLOC, "dri2_create_surface");
- goto cleanup_drm;
+ goto cleanup_dpy_wrapper;
}
wl_proxy_set_queue((struct wl_proxy *)dri2_surf->wl_surface_wrapper,
dri2_surf->wl_queue);
@@ -200,7 +200,7 @@ dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
dri2_surf);
if (dri2_surf->dri_drawable == NULL) {
_eglError(EGL_BAD_ALLOC, "createNewDrawable");
- goto cleanup_surf;
+ goto cleanup_surf_wrapper;
}
dri2_wl_swap_interval(drv, disp, &dri2_surf->base,
@@ -208,6 +208,10 @@ dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
return &dri2_surf->base;
+ cleanup_surf_wrapper:
+ wl_proxy_wrapper_destroy(dri2_surf->wl_surface_wrapper);
+ cleanup_dpy_wrapper:
+ wl_proxy_wrapper_destroy(dri2_surf->wl_dpy_wrapper);
cleanup_drm:
if (dri2_surf->wl_drm_wrapper)
wl_proxy_wrapper_destroy(dri2_surf->wl_drm_wrapper);