From 423b569fdd56f052418dc9b46de239d587dfd330 Mon Sep 17 00:00:00 2001 From: John Lindgren Date: Mon, 17 Jul 2023 03:37:21 -0400 Subject: [PATCH] xwayland: Fix segfault at exit (seen with wlroots master) --- src/xwayland.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/xwayland.c b/src/xwayland.c index 6e1c7b83..cd337e24 100644 --- a/src/xwayland.c +++ b/src/xwayland.c @@ -748,6 +748,11 @@ xwayland_server_init(struct server *server, struct wlr_compositor *compositor) void xwayland_server_finish(struct server *server) { - wlr_xwayland_destroy(server->xwayland); + struct wlr_xwayland *xwayland = server->xwayland; + /* + * Reset server->xwayland to NULL first to prevent callbacks (like + * server_global_filter) from accessing it as it is destroyed + */ server->xwayland = NULL; + wlr_xwayland_destroy(xwayland); }