Use wl_signal_emit_mutable()

This function fixes segfaults when emitting a signal potentially
removes arbitrary listeners.
This commit is contained in:
Simon Ser 2022-11-10 14:35:14 +01:00 committed by Kirill Primak
parent 6c3b35701d
commit dcd2076f38
5 changed files with 9 additions and 9 deletions

View file

@ -49,7 +49,7 @@ struct sway_container *container_create(struct sway_view *view) {
c->outputs = create_list();
wl_signal_init(&c->events.destroy);
wl_signal_emit(&root->events.new_node, &c->node);
wl_signal_emit_mutable(&root->events.new_node, &c->node);
return c;
}
@ -104,7 +104,7 @@ void container_begin_destroy(struct sway_container *con) {
container_fullscreen_disable(con);
}
wl_signal_emit(&con->node.events.destroy, &con->node);
wl_signal_emit_mutable(&con->node.events.destroy, &con->node);
container_end_mouse_operation(con);