diff options
author | Wim Taymans <wtaymans@redhat.com> | 2019-07-16 18:52:40 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2019-07-16 18:52:40 +0200 |
commit | 11830871dfdc82329e39a849834450fd6946871a (patch) | |
tree | d311fb7da4341e9bdfe50d2c36d711174f99697e /src/modules/module-client-node/client-node.c | |
parent | a54efe85814bee82a20cb53368965abfd1884a92 (diff) |
client-node: improve cleanup
Diffstat (limited to 'src/modules/module-client-node/client-node.c')
-rw-r--r-- | src/modules/module-client-node/client-node.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/modules/module-client-node/client-node.c b/src/modules/module-client-node/client-node.c index 0aa46383..b6baf020 100644 --- a/src/modules/module-client-node/client-node.c +++ b/src/modules/module-client-node/client-node.c @@ -1253,7 +1253,8 @@ static void client_node_resource_destroy(void *data) true, &node->data_source); } - pw_node_destroy(this->node); + if (this->node) + pw_node_destroy(this->node); } static void client_node_resource_error(void *data, int seq, int res, const char *message) @@ -1348,13 +1349,19 @@ static void node_initialized(void *data) static void node_free(void *data) { struct impl *impl = data; + struct pw_client_node *this = &impl->this; struct spa_system *data_system = impl->node.data_system; + this->node = NULL; + pw_log_debug(NAME " %p: free", &impl->this); node_clear(&impl->node); spa_hook_remove(&impl->node_listener); + if (this->resource) + pw_resource_destroy(this->resource); + pw_array_clear(&impl->mems); if (impl->io_areas) pw_memblock_free(impl->io_areas); |