summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <[email protected]>2017-08-29 11:51:20 +0200
committerAndres Gomez <[email protected]>2017-09-06 18:05:10 +0300
commit52e70819b4302d06dbfc3fd3dd655e79aefba7c8 (patch)
tree7d495e496e2dd4211fad12e0bc13379e2313432f
parentedbb6d405cb69849501c1df87dff69504604a2e6 (diff)
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]> (cherry picked from commit 81d5c31631840db704337489cf677cc596da79f5) [Andres Gomez: resolve trivial conflicts] Signed-off-by: Andres Gomez <[email protected]> Conflicts: src/egl/drivers/dri2/egl_dri2.c
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 9d91f4c8a29..62d9797ff1d 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -936,9 +936,12 @@ dri2_display_release(_EGLDisplay *disp)
wl_drm_destroy(dri2_dpy->wl_drm);
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);
if (dri2_dpy->own_device) {
wl_display_disconnect(dri2_dpy->wl_dpy);
}