Module: Mesa Branch: master Commit: 81d5c31631840db704337489cf677cc596da79f5 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=81d5c31631840db704337489cf677cc596da79f5
Author: Michael Olbrich <[email protected]> Date: Tue Aug 29 11:51:20 2017 +0200 egl/dri2: only destroy created objects dri2_display_destroy may be called by dri2_initialize_wayland_drm() if initialization fails. In this case, these objects may not be initialized. Cc: [email protected] Signed-off-by: Michael Olbrich <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]> --- src/egl/drivers/dri2/egl_dri2.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 3a64f3a5b6..af238a974c 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -980,9 +980,12 @@ dri2_display_destroy(_EGLDisplay *disp) zwp_linux_dmabuf_v1_destroy(dri2_dpy->wl_dmabuf); if (dri2_dpy->wl_shm) wl_shm_destroy(dri2_dpy->wl_shm); - wl_registry_destroy(dri2_dpy->wl_registry); - wl_event_queue_destroy(dri2_dpy->wl_queue); - wl_proxy_wrapper_destroy(dri2_dpy->wl_dpy_wrapper); + if (dri2_dpy->wl_registry) + wl_registry_destroy(dri2_dpy->wl_registry); + if (dri2_dpy->wl_queue) + wl_event_queue_destroy(dri2_dpy->wl_queue); + if (dri2_dpy->wl_dpy_wrapper) + wl_proxy_wrapper_destroy(dri2_dpy->wl_dpy_wrapper); u_vector_finish(&dri2_dpy->wl_modifiers.argb8888); u_vector_finish(&dri2_dpy->wl_modifiers.xrgb8888); u_vector_finish(&dri2_dpy->wl_modifiers.rgb565); _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
