]> git.mdlowis.com Git - proto/labwc.git/commitdiff
project wide: clean up event listeners on shutdown (part 2)
authortokyo4j <hrak1529@gmail.com>
Thu, 13 Mar 2025 08:39:23 +0000 (17:39 +0900)
committerJohan Malm <johanmalm@users.noreply.github.com>
Thu, 13 Mar 2025 20:08:59 +0000 (20:08 +0000)
src/input/cursor.c
src/server.c
src/workspaces.c

index 503c2d186700801c9ee428e0260f141097833e14..ce0a67993ea5ae9061dfe4d239b29e4f19d0fba0 100644 (file)
@@ -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);
index 5333759390a1435e42f8ac9cd3735a56f156da36..9e87655ede791dc11fe6f1c3d2d9b1758938228e 100644 (file)
@@ -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);
index 79f416b049cb35ce80b7473c097da226ed4e30d7..b17f986e0b644492bdb5053ad4d15fbf61716256 100644 (file)
@@ -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);