mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
client-node: improve cleanup
This commit is contained in:
parent
a54efe8581
commit
11830871df
2 changed files with 29 additions and 7 deletions
|
|
@ -1253,6 +1253,7 @@ static void client_node_resource_destroy(void *data)
|
||||||
true,
|
true,
|
||||||
&node->data_source);
|
&node->data_source);
|
||||||
}
|
}
|
||||||
|
if (this->node)
|
||||||
pw_node_destroy(this->node);
|
pw_node_destroy(this->node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1348,13 +1349,19 @@ static void node_initialized(void *data)
|
||||||
static void node_free(void *data)
|
static void node_free(void *data)
|
||||||
{
|
{
|
||||||
struct impl *impl = data;
|
struct impl *impl = data;
|
||||||
|
struct pw_client_node *this = &impl->this;
|
||||||
struct spa_system *data_system = impl->node.data_system;
|
struct spa_system *data_system = impl->node.data_system;
|
||||||
|
|
||||||
|
this->node = NULL;
|
||||||
|
|
||||||
pw_log_debug(NAME " %p: free", &impl->this);
|
pw_log_debug(NAME " %p: free", &impl->this);
|
||||||
node_clear(&impl->node);
|
node_clear(&impl->node);
|
||||||
|
|
||||||
spa_hook_remove(&impl->node_listener);
|
spa_hook_remove(&impl->node_listener);
|
||||||
|
|
||||||
|
if (this->resource)
|
||||||
|
pw_resource_destroy(this->resource);
|
||||||
|
|
||||||
pw_array_clear(&impl->mems);
|
pw_array_clear(&impl->mems);
|
||||||
if (impl->io_areas)
|
if (impl->io_areas)
|
||||||
pw_memblock_free(impl->io_areas);
|
pw_memblock_free(impl->io_areas);
|
||||||
|
|
|
||||||
|
|
@ -1037,12 +1037,14 @@ static void do_node_init(struct pw_proxy *proxy)
|
||||||
|
|
||||||
static void clear_mix(struct node_data *data, struct mix *mix)
|
static void clear_mix(struct node_data *data, struct mix *mix)
|
||||||
{
|
{
|
||||||
clear_buffers(data, mix);
|
|
||||||
pw_array_clear(&mix->buffers);
|
|
||||||
|
|
||||||
deactivate_mix(data, mix);
|
deactivate_mix(data, mix);
|
||||||
|
|
||||||
spa_list_remove(&mix->link);
|
spa_list_remove(&mix->link);
|
||||||
|
|
||||||
|
clear_buffers(data, mix);
|
||||||
|
pw_array_clear(&mix->buffers);
|
||||||
|
|
||||||
|
spa_list_remove(&mix->mix.link);
|
||||||
spa_list_append(&data->free_mix, &mix->link);
|
spa_list_append(&data->free_mix, &mix->link);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1071,12 +1073,14 @@ static void node_destroy(void *data)
|
||||||
static void node_free(void *data)
|
static void node_free(void *data)
|
||||||
{
|
{
|
||||||
struct node_data *d = data;
|
struct node_data *d = data;
|
||||||
struct pw_proxy *proxy = (struct pw_proxy*) d->node_proxy;
|
|
||||||
|
|
||||||
pw_log_debug("%p: free", d);
|
pw_log_debug("%p: free", d);
|
||||||
|
|
||||||
|
if (d->proxy) {
|
||||||
pw_proxy_destroy(d->proxy);
|
pw_proxy_destroy(d->proxy);
|
||||||
pw_proxy_destroy(proxy);
|
d->proxy = NULL;
|
||||||
|
}
|
||||||
|
pw_proxy_destroy((struct pw_proxy*)d->node_proxy);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void node_info_changed(void *data, const struct pw_node_info *info)
|
static void node_info_changed(void *data, const struct pw_node_info *info)
|
||||||
|
|
@ -1132,8 +1136,19 @@ static const struct pw_node_events node_events = {
|
||||||
static void node_proxy_destroy(void *_data)
|
static void node_proxy_destroy(void *_data)
|
||||||
{
|
{
|
||||||
struct node_data *data = _data;
|
struct node_data *data = _data;
|
||||||
|
|
||||||
|
pw_log_debug("%p: destroy", data);
|
||||||
|
|
||||||
clean_node(data);
|
clean_node(data);
|
||||||
|
|
||||||
spa_hook_remove(&data->node_listener);
|
spa_hook_remove(&data->node_listener);
|
||||||
|
|
||||||
|
data->node_proxy = NULL;
|
||||||
|
|
||||||
|
if (data->proxy) {
|
||||||
|
pw_proxy_destroy(data->proxy);
|
||||||
|
data->proxy = NULL;
|
||||||
|
}
|
||||||
if (data->do_free)
|
if (data->do_free)
|
||||||
pw_node_destroy(data->node);
|
pw_node_destroy(data->node);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue