diff options
| author | Derek Foreman <derekf@osg.samsung.com> | 2017-12-28 15:15:46 +0000 |
|---|---|---|
| committer | Daniel Stone <daniels@collabora.com> | 2017-12-28 15:16:37 +0000 |
| commit | 69fab4fffcab68e355a5c181641cee5a4ead769f (patch) | |
| tree | 49f125325070f5c4778c870c6400351daa586427 /src/connection.c | |
| parent | util: Pass flags to map iterators (diff) | |
| download | wayland-69fab4fffcab68e355a5c181641cee5a4ead769f.tar wayland-69fab4fffcab68e355a5c181641cee5a4ead769f.tar.gz wayland-69fab4fffcab68e355a5c181641cee5a4ead769f.tar.bz2 wayland-69fab4fffcab68e355a5c181641cee5a4ead769f.tar.lz wayland-69fab4fffcab68e355a5c181641cee5a4ead769f.tar.xz wayland-69fab4fffcab68e355a5c181641cee5a4ead769f.tar.zst wayland-69fab4fffcab68e355a5c181641cee5a4ead769f.zip | |
client: Add wl_object_is_zombie() helper function
Add a helper function which determines whether or not an object is a
zombie.
[daniels: Extracted from Derek's bespoke-zombie patch as an intermediate
step.]
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Diffstat (limited to 'src/connection.c')
| -rw-r--r-- | src/connection.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/connection.c b/src/connection.c index e92de79..2e234ea 100644 --- a/src/connection.c +++ b/src/connection.c @@ -831,6 +831,14 @@ wl_connection_demarshal(struct wl_connection *connection, return NULL; } +bool +wl_object_is_zombie(struct wl_map *map, uint32_t id) +{ + struct wl_object *object = wl_map_lookup(map, id); + + return (object == WL_ZOMBIE_OBJECT); +} + int wl_closure_lookup_objects(struct wl_closure *closure, struct wl_map *objects) { @@ -852,7 +860,7 @@ wl_closure_lookup_objects(struct wl_closure *closure, struct wl_map *objects) closure->args[i].o = NULL; object = wl_map_lookup(objects, id); - if (object == WL_ZOMBIE_OBJECT) { + if (wl_object_is_zombie(objects, id)) { /* references object we've already * destroyed client side */ object = NULL; |
