[Mesa-dev] [PATCH 1/9] egl/wayland: properly destroy wayland objects
Dave Airlie
airlied at gmail.com
Tue May 5 17:34:10 PDT 2015
On 2 May 2015 at 20:15, Axel Davy <axel.davy at ens.fr> wrote:
> the wl_registry and the wl_queue allocated weren't destroyed.
>
> Signed-off-by: Axel Davy <axel.davy at ens.fr>
Reviewed-by: Dave Airlie <airlied at redhat.com>
> ---
> src/egl/drivers/dri2/egl_dri2.c | 2 ++
> src/egl/drivers/dri2/platform_wayland.c | 5 ++++-
> 2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
> index a428f28..1145eed 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -710,6 +710,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 e226005..a5bcf25 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);
>
> --
> 2.3.7
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list