From 3f0b3f8f9b3b737fd0e6d36e2a2c469b07268ec2 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 14 Apr 2025 09:29:45 +0200 Subject: 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 f7155a77..5aa5f4f9 100644 --- a/sway/server.c +++ b/sway/server.c @@ -496,9 +496,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); -- cgit v1.2.3