From 8d85c43355fabfea2a3a43d0664ebfbaa2608450 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Mon, 23 Oct 2023 20:09:34 +0300 Subject: [PATCH] backend-x11: Move back-end removal to the destroy function Otherwise we end up with an invalid backend on the shutdown path of the compositor. This mimics what the wayland back-end does. Fixes 14c52a942b, 'backend-x11: enable multi-backend support'. Signed-off-by: Marius Vlad --- libweston/backend-x11/x11.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libweston/backend-x11/x11.c b/libweston/backend-x11/x11.c index 8e16315f..8f55e8d7 100644 --- a/libweston/backend-x11/x11.c +++ b/libweston/backend-x11/x11.c @@ -1840,7 +1840,6 @@ x11_shutdown(struct weston_backend *base) { struct x11_backend *backend = to_x11_backend(base); - wl_list_remove(&backend->base.link); wl_event_source_remove(backend->xcb_source); x11_input_destroy(backend); @@ -1853,6 +1852,8 @@ x11_destroy(struct weston_backend *base) struct weston_compositor *ec = backend->compositor; struct weston_head *head, *next; + wl_list_remove(&backend->base.link); + wl_list_for_each_safe(head, next, &ec->head_list, compositor_link) { if (to_x11_head(head)) x11_head_destroy(head);