XdgToplevel: clean up wlr_surface data on destroy

This commit is contained in:
Isaac Freund 2023-03-08 12:20:27 +01:00
parent f072d19e51
commit ebfa892d95
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11

View File

@ -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();
}