aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/connection.c10
-rw-r--r--src/wayland-client.c4
-rw-r--r--src/wayland-private.h3
3 files changed, 14 insertions, 3 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;
diff --git a/src/wayland-client.c b/src/wayland-client.c
index 795b4e9..126dd90 100644
--- a/src/wayland-client.c
+++ b/src/wayland-client.c
@@ -837,7 +837,7 @@ display_handle_delete_id(void *data, struct wl_display *display, uint32_t id)
if (!proxy)
wl_log("error: received delete_id for unknown id (%u)\n", id);
- if (proxy && proxy != WL_ZOMBIE_OBJECT)
+ if (proxy && !wl_object_is_zombie(&display->objects, id))
proxy->flags |= WL_PROXY_FLAG_ID_DELETED;
else
wl_map_remove(&display->objects, id);
@@ -1253,7 +1253,7 @@ queue_event(struct wl_display *display, int len)
return 0;
proxy = wl_map_lookup(&display->objects, id);
- if (!proxy || proxy == WL_ZOMBIE_OBJECT) {
+ if (!proxy || wl_object_is_zombie(&display->objects, id)) {
wl_connection_consume(display->connection, size);
return size;
}
diff --git a/src/wayland-private.h b/src/wayland-private.h
index 93cec6b..c82b1f3 100644
--- a/src/wayland-private.h
+++ b/src/wayland-private.h
@@ -190,6 +190,9 @@ wl_connection_demarshal(struct wl_connection *connection,
struct wl_map *objects,
const struct wl_message *message);
+bool
+wl_object_is_zombie(struct wl_map *map, uint32_t id);
+
int
wl_closure_lookup_objects(struct wl_closure *closure, struct wl_map *objects);