proxy: reuse id when server removed it

When we destroy the proxy, just clear the id. We then remove the id
completely when the server sends a remove_id request. This avoid
reusing the proxy id before the server has finished with it.
This commit is contained in:
Wim Taymans 2018-06-15 13:01:08 +02:00
parent d1e2f69324
commit c208511f53
2 changed files with 2 additions and 1 deletions

View file

@ -121,7 +121,7 @@ void pw_proxy_destroy(struct pw_proxy *proxy)
pw_log_debug("proxy %p: destroy %u", proxy, proxy->id);
spa_hook_list_call(&proxy->listener_list, struct pw_proxy_events, destroy);
pw_map_remove(&proxy->remote->objects, proxy->id);
pw_map_insert_at(&proxy->remote->objects, proxy->id, NULL);
spa_list_remove(&proxy->link);
free(impl);

View file

@ -188,6 +188,7 @@ static void core_event_remove_id(void *data, uint32_t id)
pw_log_debug("remote %p: object remove %u", this, id);
pw_proxy_destroy(proxy);
}
pw_map_remove(&this->objects, id);
}
static void