backend-wayland: fix error path in wayland_backend_create

Destroy the renderer before disconnecting the Wayland display.

Trying to destroy the GL renderer with the Wayland display already gone
crashes in the Mesa Wayland integration.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
This commit is contained in:
Philipp Zabel 2023-06-21 10:19:16 +02:00 committed by Daniel Stone
parent da683dad57
commit 47180ad253

View file

@ -2938,7 +2938,7 @@ wayland_backend_create(struct weston_compositor *compositor,
wl_event_loop_add_fd(loop, fd, WL_EVENT_READABLE,
wayland_backend_handle_event, b);
if (b->parent.wl_source == NULL)
goto err_display;
goto err_renderer;
wl_event_source_check(b->parent.wl_source);
@ -2949,6 +2949,8 @@ wayland_backend_create(struct weston_compositor *compositor,
}
return b;
err_renderer:
compositor->renderer->destroy(compositor);
err_display:
wl_display_disconnect(b->parent.wl_display);
err_compositor: