From 440d7fa072d392ca076f73d5de469cb165d2499a Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 8 Nov 2022 17:43:49 +0100 Subject: [PATCH] scene: destroy addons before cleaning up internal state This allows addons to access wlr_scene_node/wlr_scene_surface fields to clean up themselves. --- types/scene/wlr_scene.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index 1be2d131..0eed5884 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/wlr_scene.c @@ -87,6 +87,7 @@ void wlr_scene_node_destroy(struct wlr_scene_node *node) { // in case the destroy signal would like to remove children before they // are recursively destroyed. wl_signal_emit_mutable(&node->events.destroy, NULL); + wlr_addon_set_finish(&node->addons); wlr_scene_node_set_enabled(node, false); @@ -130,7 +131,6 @@ void wlr_scene_node_destroy(struct wlr_scene_node *node) { } } - wlr_addon_set_finish(&node->addons); wl_list_remove(&node->link); pixman_region32_fini(&node->visible); free(node);