diff options
author | Jonas Ådahl <[email protected]> | 2017-01-13 23:05:09 +0800 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-01-13 15:50:04 +0000 |
commit | 361796651c5abb21ff429466c061119dce8f33d5 (patch) | |
tree | b215b57df5f424c0ad5f80e0f102aab542891e4a /src/egl/drivers | |
parent | cba808695148cda65be5c8df2d8be76e406369b1 (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]>
Diffstat (limited to 'src/egl/drivers')
-rw-r--r-- | src/egl/drivers/dri2/platform_wayland.c | 4 |
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 fd4812a4fee..2b50d8ec949 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; @@ -1921,6 +1923,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; |