mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 17:48:10 +02:00
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 <jadahl@gmail.com> Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
parent
cba8086951
commit
361796651c
1 changed files with 4 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue