From ebfa892d95688aa9a5f1e3c822515765cb9a2169 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Wed, 8 Mar 2023 12:20:27 +0100 Subject: [PATCH] XdgToplevel: clean up wlr_surface data on destroy --- river/XdgToplevel.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/river/XdgToplevel.zig b/river/XdgToplevel.zig index a3a96ac..d5e84f9 100644 --- a/river/XdgToplevel.zig +++ b/river/XdgToplevel.zig @@ -171,6 +171,9 @@ fn handleDestroy(listener: *wl.Listener(void)) void { self.map.link.remove(); self.unmap.link.remove(); + // The wlr_surface may outlive the wlr_xdg_surface so we must clean up the user data. + self.xdg_toplevel.base.surface.data = 0; + self.view.destroy(); }