project wide: clean up event listeners on shutdown

This ensures all event listeners are removed before the emitting
wlroots object is being destroyed. This will be enforced with asserts
in wlroots 0.19 but there is no reason to not do it right now either.

This change in wlroots 0.19 is implemented via commit
8f56f7ca43257cc05c7c4eb57a0f541e05cf9a79
"Assert (almost all) signals have no attached listeners on destroy"
This commit is contained in:
Consolatis 2025-02-08 15:48:50 +01:00 committed by Hiroaki Yamamoto
parent 4750214d42
commit 9e6aaa689a
13 changed files with 77 additions and 10 deletions

View file

@ -133,3 +133,8 @@ kde_server_decoration_init(struct server *server)
server->kde_server_decoration.notify = handle_new_server_decoration;
}
void
kde_server_decoration_finish(struct server *server)
{
wl_list_remove(&server->kde_server_decoration.link);
}

View file

@ -127,3 +127,9 @@ xdg_server_decoration_init(struct server *server)
&server->xdg_toplevel_decoration);
server->xdg_toplevel_decoration.notify = xdg_toplevel_decoration;
}
void
xdg_server_decoration_finish(struct server *server)
{
wl_list_remove(&server->xdg_toplevel_decoration.link);
}