mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-03-07 04:34:49 -05:00
server: introduce wl_signal_emit_mutable
wl_signal_emit doesn't handle well situations where a listener removes another listener. This can happen in practice: wlroots and Weston [1] both have private helpers to workaround this defect. wl_signal_emit can't be fixed without breaking the API. Instead, introduce a new function. Callers need to make sure to always remove listeners when they are free'd. [1]: https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/457 Signed-off-by: Simon Ser <contact@emersion.fr> Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
This commit is contained in:
parent
868eb99eb0
commit
962aefda42
3 changed files with 107 additions and 0 deletions
|
|
@ -481,6 +481,9 @@ wl_signal_emit(struct wl_signal *signal, void *data)
|
|||
l->notify(l, data);
|
||||
}
|
||||
|
||||
void
|
||||
wl_signal_emit_mutable(struct wl_signal *signal, void *data);
|
||||
|
||||
typedef void (*wl_resource_destroy_func_t)(struct wl_resource *resource);
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue