diff options
| author | Derek Foreman <derekf@osg.samsung.com> | 2017-12-28 15:28:11 +0000 |
|---|---|---|
| committer | Daniel Stone <daniels@collabora.com> | 2017-12-28 19:43:20 +0000 |
| commit | 712ba320db29923197158905703cc81fa9b0b3e5 (patch) | |
| tree | c6fe81984c3beafd513a107dfb62a77fba158f51 /src | |
| parent | client: Add WL_MAP_ENTRY_ZOMBIE flag (diff) | |
| download | wayland-712ba320db29923197158905703cc81fa9b0b3e5.tar wayland-712ba320db29923197158905703cc81fa9b0b3e5.tar.gz wayland-712ba320db29923197158905703cc81fa9b0b3e5.tar.bz2 wayland-712ba320db29923197158905703cc81fa9b0b3e5.tar.lz wayland-712ba320db29923197158905703cc81fa9b0b3e5.tar.xz wayland-712ba320db29923197158905703cc81fa9b0b3e5.tar.zst wayland-712ba320db29923197158905703cc81fa9b0b3e5.zip | |
client: Restructure delete_id handler control flow
This makes it easier for future patches in the series, which can
possibly return NULL for extant map entries.
[daniels: Extracted from Derek's bespoke-zombie patch as an intermediate
step.]
Reviewed-by: Daniel Stone <daniels@collabora.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/wayland-client.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/wayland-client.c b/src/wayland-client.c index 8fc5634..83f76ec 100644 --- a/src/wayland-client.c +++ b/src/wayland-client.c @@ -836,13 +836,12 @@ display_handle_delete_id(void *data, struct wl_display *display, uint32_t id) proxy = wl_map_lookup(&display->objects, id); - if (!proxy) - wl_log("error: received delete_id for unknown id (%u)\n", id); - - if (proxy && !wl_object_is_zombie(&display->objects, id)) + if (wl_object_is_zombie(&display->objects, id)) + wl_map_remove(&display->objects, id); + else if (proxy) proxy->flags |= WL_PROXY_FLAG_ID_DELETED; else - wl_map_remove(&display->objects, id); + wl_log("error: received delete_id for unknown id (%u)\n", id); pthread_mutex_unlock(&display->mutex); } |
