client-stream: improve cleanup

This commit is contained in:
Wim Taymans 2019-03-11 22:07:17 +01:00
parent 4d99bf9297
commit 743874dd9f
2 changed files with 16 additions and 5 deletions

View file

@ -1122,6 +1122,7 @@ static void client_node_destroy(void *data)
spa_hook_remove(&impl->node_listener);
pw_node_destroy(impl->this.node);
impl->this.node = NULL;
}
static void client_node_free(void *data)
@ -1155,6 +1156,7 @@ static void client_node_info_changed(void *data, const struct pw_node_info *info
pw_log_debug("client-stream %p: info changed", this);
if (this->node)
pw_node_update_properties(this->node, info->props);
}
@ -1309,4 +1311,5 @@ void pw_client_stream_destroy(struct pw_client_stream *stream)
{
struct impl *impl = SPA_CONTAINER_OF(stream, struct impl, this);
pw_client_node_destroy(impl->client_node);
impl->client_node = NULL;
}

View file

@ -1114,16 +1114,23 @@ static void clean_node(struct node_data *d)
static void node_destroy(void *data)
{
struct node_data *d = data;
struct pw_remote *remote = d->remote;
struct pw_proxy *proxy = (struct pw_proxy*) d->node_proxy;
pw_log_debug("%p: destroy", d);
clean_node(d);
}
static void node_free(void *data)
{
struct node_data *d = data;
struct pw_remote *remote = d->remote;
struct pw_proxy *proxy = (struct pw_proxy*) d->node_proxy;
pw_log_debug("%p: free", d);
if (remote->core_proxy)
pw_core_proxy_destroy(remote->core_proxy, proxy);
clean_node(d);
spa_hook_remove(&d->proxy_listener);
}
@ -1171,6 +1178,7 @@ static void node_active_changed(void *data, bool active)
static const struct pw_node_events node_events = {
PW_VERSION_NODE_EVENTS,
.destroy = node_destroy,
.free = node_free,
.info_changed = node_info_changed,
.port_info_changed = node_port_info_changed,
.active_changed = node_active_changed,