proxy: improve proxy cleanup

When we destroy a proxy, mark it as zombie until the server removes
the id. This way we can still keep the id locked with a valid entry
and remove it later.
This commit is contained in:
Wim Taymans 2019-08-14 11:46:07 +02:00
parent d86e462dca
commit 35f617157f
4 changed files with 26 additions and 16 deletions

View file

@ -532,11 +532,15 @@ on_remote_data(void *data, int fd, uint32_t mask)
spa_debug_pod(0, NULL, (struct spa_pod *)msg->data);
}
proxy = pw_remote_find_proxy(this, msg->id);
proxy = pw_remote_find_proxy(this, msg->id);
if (proxy == NULL || proxy->zombie) {
if (proxy->zombie)
pw_log_debug(NAME" %p: zombie proxy %u", this, msg->id);
else
pw_log_error(NAME" %p: could not find proxy %u", this, msg->id);
if (proxy == NULL) {
pw_log_error("protocol-native %p: could not find proxy %u", this, msg->id);
continue;
/* FIXME close fds */
continue;
}
marshal = pw_proxy_get_marshal(proxy);