From: John Lindgren Date: Mon, 17 Jul 2023 07:37:21 +0000 (-0400) Subject: xwayland: Fix segfault at exit (seen with wlroots master) X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=423b569fdd56f052418dc9b46de239d587dfd330;p=proto%2Flabwc.git xwayland: Fix segfault at exit (seen with wlroots master) --- 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); }