summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJonas Ådahl <[email protected]>2017-01-13 23:05:09 +0800
committerEmil Velikov <[email protected]>2017-01-24 01:13:30 +0000
commitbf556db1c965aa5f6af9e81dbec179bf1e139ee9 (patch)
tree290cfaa02037348ced875ac4fa14bc60ac845985 /src
parentc0709db9cfe73d849e469c469f30254bbf8b84a5 (diff)
egl/wayland: Cleanup private display connection when init fails
When failing to initializing the Wayland EGL driver, don't leak the display server connection if it was us who created it. Signed-off-by: Jonas Ådahl <[email protected]> Cc: [email protected] Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]> (cherry picked from commit 361796651c5abb21ff429466c061119dce8f33d5)
Diffstat (limited to 'src')
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index 789e0355956..b479e0d77ab 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -1283,6 +1283,8 @@ dri2_initialize_wayland_drm(_EGLDriver *drv, _EGLDisplay *disp)
cleanup_registry:
wl_registry_destroy(dri2_dpy->wl_registry);
wl_event_queue_destroy(dri2_dpy->wl_queue);
+ if (disp->PlatformDisplay == NULL)
+ wl_display_disconnect(dri2_dpy->wl_dpy);
cleanup_dpy:
free(dri2_dpy);
disp->DriverData = NULL;
@@ -1924,6 +1926,8 @@ dri2_initialize_wayland_swrast(_EGLDriver *drv, _EGLDisplay *disp)
cleanup_registry:
wl_registry_destroy(dri2_dpy->wl_registry);
wl_event_queue_destroy(dri2_dpy->wl_queue);
+ if (disp->PlatformDisplay == NULL)
+ wl_display_disconnect(dri2_dpy->wl_dpy);
cleanup_dpy:
free(dri2_dpy);
disp->DriverData = NULL;