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/workspace.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/workspace.c')
-rw-r--r-- | sway/tree/workspace.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index c84320bd..0c4e97a3 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c | |||
@@ -114,7 +114,7 @@ struct sway_workspace *workspace_create(struct sway_output *output, | |||
114 | output_sort_workspaces(output); | 114 | output_sort_workspaces(output); |
115 | 115 | ||
116 | ipc_event_workspace(NULL, ws, "init"); | 116 | ipc_event_workspace(NULL, ws, "init"); |
117 | wl_signal_emit(&root->events.new_node, &ws->node); | 117 | wl_signal_emit_mutable(&root->events.new_node, &ws->node); |
118 | 118 | ||
119 | return ws; | 119 | return ws; |
120 | } | 120 | } |
@@ -142,7 +142,7 @@ void workspace_destroy(struct sway_workspace *workspace) { | |||
142 | void workspace_begin_destroy(struct sway_workspace *workspace) { | 142 | void workspace_begin_destroy(struct sway_workspace *workspace) { |
143 | sway_log(SWAY_DEBUG, "Destroying workspace '%s'", workspace->name); | 143 | sway_log(SWAY_DEBUG, "Destroying workspace '%s'", workspace->name); |
144 | ipc_event_workspace(NULL, workspace, "empty"); // intentional | 144 | ipc_event_workspace(NULL, workspace, "empty"); // intentional |
145 | wl_signal_emit(&workspace->node.events.destroy, &workspace->node); | 145 | wl_signal_emit_mutable(&workspace->node.events.destroy, &workspace->node); |
146 | 146 | ||
147 | if (workspace->output) { | 147 | if (workspace->output) { |
148 | workspace_detach(workspace); | 148 | workspace_detach(workspace); |