client-node: clean up our memory mappings

Loop over our memory mappings and clean them up when we are destroyed.
This commit is contained in:
Wim Taymans 2020-07-10 12:46:48 +02:00
parent ff8aaf9e62
commit 0430e7b8dc

View file

@ -1324,6 +1324,8 @@ static void node_free(void *data)
struct pw_impl_client_node *this = &impl->this; struct pw_impl_client_node *this = &impl->this;
struct node *node = &impl->node; struct node *node = &impl->node;
struct spa_system *data_system = node->data_system; struct spa_system *data_system = node->data_system;
uint32_t tag[5] = { impl->node_id, };
struct pw_memmap *mm;
this->node = NULL; this->node = NULL;
@ -1332,6 +1334,9 @@ static void node_free(void *data)
spa_hook_remove(&impl->node_listener); spa_hook_remove(&impl->node_listener);
while ((mm = pw_mempool_find_tag(impl->context->pool, tag, sizeof(uint32_t))) != NULL)
pw_memmap_free(mm);
if (this->resource) if (this->resource)
pw_resource_destroy(this->resource); pw_resource_destroy(this->resource);