mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-05 13:29:50 -05:00
server: add wl_global_set_user_data
When implementing a workaround for [1], one needs to accept a global to be bound even though it has become stale. Often, a global's user data is free'd when the global needs to be destroyed. Being able to set the global's user data (e.g. to NULL) can help preventing a use-after-free. (The alternative is to make the compositor responsible for keeping track of stale user data objects via e.g. refcounting.) [1]: https://gitlab.freedesktop.org/wayland/wayland/issues/10 Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
parent
766edf0243
commit
d5055ad913
2 changed files with 16 additions and 0 deletions
|
|
@ -279,6 +279,9 @@ wl_global_get_interface(const struct wl_global *global);
|
|||
void *
|
||||
wl_global_get_user_data(const struct wl_global *global);
|
||||
|
||||
void
|
||||
wl_global_set_user_data(struct wl_global *global, void *data);
|
||||
|
||||
struct wl_client *
|
||||
wl_client_create(struct wl_display *display, int fd);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue