tree/node: Do not mark destroying nodes as dirty

Node destruction currently runs through the transaction system such that
a particular node is only destroyed after its use in an ongoing
transaction. If a node is dirtied after the node is marked as destroying
but before it is destroyed, the pointer added to dirty_nodes would
become a dangling pointer once the node was destroyed.

Do not dirty destroying nodes, and ensure that destroying is only set
after the last dirty.
This commit is contained in:
Kenny Levinsen 2025-07-31 15:44:49 +02:00 committed by Simon Ser
parent 14fbe9242f
commit 357d341f8f
4 changed files with 4 additions and 4 deletions

View file

@ -301,8 +301,8 @@ void output_begin_destroy(struct sway_output *output) {
sway_log(SWAY_DEBUG, "Destroying output '%s'", output->wlr_output->name);
wl_signal_emit_mutable(&output->node.events.destroy, &output->node);
output->node.destroying = true;
node_set_dirty(&output->node);
output->node.destroying = true;
}
struct sway_output *output_from_wlr_output(struct wlr_output *output) {