From 140e913c447630dd05970fe8087a1698df9f6f1d Mon Sep 17 00:00:00 2001 From: tokyo4j Date: Thu, 13 Mar 2025 17:39:23 +0900 Subject: [PATCH] project wide: clean up event listeners on shutdown (part 2) --- src/input/cursor.c | 2 -- src/server.c | 4 ++++ src/workspaces.c | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/input/cursor.c b/src/input/cursor.c index 503c2d18..ce0a6799 100644 --- a/src/input/cursor.c +++ b/src/input/cursor.c @@ -1504,8 +1504,6 @@ cursor_init(struct seat *seat) void cursor_finish(struct seat *seat) { - /* TODO: either clean up all the listeners or none of them */ - wl_list_remove(&seat->cursor_motion.link); wl_list_remove(&seat->cursor_motion_absolute.link); wl_list_remove(&seat->cursor_button.link); diff --git a/src/server.c b/src/server.c index 53337593..9e87655e 100644 --- a/src/server.c +++ b/src/server.c @@ -762,6 +762,10 @@ server_finish(struct server *server) wl_list_remove(&server->new_constraint.link); wl_list_remove(&server->output_power_manager_set_mode.link); wl_list_remove(&server->tearing_new_object.link); + if (server->drm_lease_request.notify) { + wl_list_remove(&server->drm_lease_request.link); + server->drm_lease_request.notify = NULL; + } wlr_backend_destroy(server->backend); wlr_allocator_destroy(server->allocator); diff --git a/src/workspaces.c b/src/workspaces.c index 79f416b0..b17f986e 100644 --- a/src/workspaces.c +++ b/src/workspaces.c @@ -469,6 +469,8 @@ destroy_workspace(struct workspace *workspace) wlr_scene_node_destroy(&workspace->tree->node); zfree(workspace->name); wl_list_remove(&workspace->link); + wl_list_remove(&workspace->on_cosmic.activate.link); + wl_list_remove(&workspace->on_ext.activate.link); lab_cosmic_workspace_destroy(workspace->cosmic_workspace); lab_ext_workspace_destroy(workspace->ext_workspace);