summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2/egl_dri2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl/drivers/dri2/egl_dri2.c')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 169abcc4c63..467b81c6e8d 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -729,7 +729,10 @@ dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
#endif
#ifdef HAVE_WAYLAND_PLATFORM
case _EGL_PLATFORM_WAYLAND:
- wl_drm_destroy(dri2_dpy->wl_drm);
+ if (dri2_dpy->wl_drm)
+ 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);
if (dri2_dpy->own_device) {