diff options
author | Simon Ser <contact@emersion.fr> | 2022-11-10 14:35:14 +0100 |
---|---|---|
committer | Kirill Primak <vyivel@eclair.cafe> | 2022-11-10 22:27:38 +0300 |
commit | dcd2076f3854f4bb0018b6a47781dc48a55393b0 (patch) | |
tree | 220eb2a4a3861a62b5c1afc9e73216cef9bf7024 /sway/tree/container.c | |
parent | ci: install hwdata (diff) | |
download | sway-dcd2076f3854f4bb0018b6a47781dc48a55393b0.tar.gz sway-dcd2076f3854f4bb0018b6a47781dc48a55393b0.tar.zst sway-dcd2076f3854f4bb0018b6a47781dc48a55393b0.zip |
Use wl_signal_emit_mutable()
This function fixes segfaults when emitting a signal potentially
removes arbitrary listeners.
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r-- | sway/tree/container.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index bf7085cb..718dd0e0 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -49,7 +49,7 @@ struct sway_container *container_create(struct sway_view *view) { | |||
49 | c->outputs = create_list(); | 49 | c->outputs = create_list(); |
50 | 50 | ||
51 | wl_signal_init(&c->events.destroy); | 51 | wl_signal_init(&c->events.destroy); |
52 | wl_signal_emit(&root->events.new_node, &c->node); | 52 | wl_signal_emit_mutable(&root->events.new_node, &c->node); |
53 | 53 | ||
54 | return c; | 54 | return c; |
55 | } | 55 | } |
@@ -104,7 +104,7 @@ void container_begin_destroy(struct sway_container *con) { | |||
104 | container_fullscreen_disable(con); | 104 | container_fullscreen_disable(con); |
105 | } | 105 | } |
106 | 106 | ||
107 | wl_signal_emit(&con->node.events.destroy, &con->node); | 107 | wl_signal_emit_mutable(&con->node.events.destroy, &con->node); |
108 | 108 | ||
109 | container_end_mouse_operation(con); | 109 | container_end_mouse_operation(con); |
110 | 110 | ||