From: Axel Davy Date: Thu, 30 Apr 2015 22:03:32 +0000 (+0200) Subject: egl/wayland: properly destroy wayland objects X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6aaf09b93b668a24b557e05195b9897e8cee8559;p=mesa.git egl/wayland: properly destroy wayland objects the wl_registry and the wl_queue allocated weren't destroyed. CC: 10.5 Reviewed-by: Dave Airlie Reviewed-by: Daniel Stone Signed-off-by: Axel Davy --- diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index f4c29da61cf..169abcc4c63 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -730,6 +730,8 @@ dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp) #ifdef HAVE_WAYLAND_PLATFORM case _EGL_PLATFORM_WAYLAND: wl_drm_destroy(dri2_dpy->wl_drm); + wl_registry_destroy(dri2_dpy->wl_registry); + wl_event_queue_destroy(dri2_dpy->wl_queue); if (dri2_dpy->own_device) { wl_display_disconnect(dri2_dpy->wl_dpy); } diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index e2260053917..a5bcf25af41 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -1029,7 +1029,7 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp) wl_registry_add_listener(dri2_dpy->wl_registry, ®istry_listener, dri2_dpy); if (roundtrip(dri2_dpy) < 0 || dri2_dpy->wl_drm == NULL) - goto cleanup_dpy; + goto cleanup_registry; if (roundtrip(dri2_dpy) < 0 || dri2_dpy->fd == -1) goto cleanup_drm; @@ -1112,6 +1112,9 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp) cleanup_drm: free(dri2_dpy->device_name); wl_drm_destroy(dri2_dpy->wl_drm); + cleanup_registry: + wl_registry_destroy(dri2_dpy->wl_registry); + wl_event_queue_destroy(dri2_dpy->wl_queue); cleanup_dpy: free(dri2_dpy);