]> git.mdlowis.com Git - proto/labwc.git/commitdiff
xwayland: Fix segfault at exit (seen with wlroots master)
authorJohn Lindgren <john@jlindgren.net>
Mon, 17 Jul 2023 07:37:21 +0000 (03:37 -0400)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Mon, 17 Jul 2023 08:22:28 +0000 (10:22 +0200)
src/xwayland.c

index 6e1c7b83f3732d6b4610f6f8c980ce44071e9fba..cd337e24575a7592f420d6af0c797be74196b92e 100644 (file)
@@ -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);
 }