From de69f0c156bf832cf0c3befbd3362a9af336a815 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 14 Apr 2025 09:29:45 +0200 Subject: [PATCH] Fix crash on shutdown when Xwayland is disabled --- sway/server.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sway/server.c b/sway/server.c index 9d882862a..9f7a5d12e 100644 --- a/sway/server.c +++ b/sway/server.c @@ -494,9 +494,11 @@ void server_fini(struct sway_server *server) { // TODO: free sway-specific resources #if WLR_HAS_XWAYLAND - wl_list_remove(&server->xwayland_surface.link); - wl_list_remove(&server->xwayland_ready.link); - wlr_xwayland_destroy(server->xwayland.wlr_xwayland); + if (server->xwayland.wlr_xwayland != NULL) { + wl_list_remove(&server->xwayland_surface.link); + wl_list_remove(&server->xwayland_ready.link); + wlr_xwayland_destroy(server->xwayland.wlr_xwayland); + } #endif wl_display_destroy_clients(server->wl_display); wlr_backend_destroy(server->backend);