summaryrefslogtreecommitdiff
path: root/src/modules/module-client-node/client-stream.c
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2019-03-06 09:52:07 +0100
committerWim Taymans <wtaymans@redhat.com>2019-03-06 09:52:07 +0100
commit5ee287d79bdc8804a4abd18595fab963aa197eb4 (patch)
treea4c6a98d0827ac3f6c7c17c7d28e17d206f27e38 /src/modules/module-client-node/client-stream.c
parent3777d9612e60f4d8c5d078e5e393da48b4d638ea (diff)
client-node: improve cleanup
Diffstat (limited to 'src/modules/module-client-node/client-stream.c')
-rw-r--r--src/modules/module-client-node/client-stream.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/modules/module-client-node/client-stream.c b/src/modules/module-client-node/client-stream.c
index 2ff27581..1b4c2894 100644
--- a/src/modules/module-client-node/client-stream.c
+++ b/src/modules/module-client-node/client-stream.c
@@ -1103,9 +1103,15 @@ static void client_node_destroy(void *data)
pw_node_set_driver(impl->client_node->node, NULL);
- spa_hook_remove(&impl->client_node_listener);
spa_hook_remove(&impl->node_listener);
pw_node_destroy(impl->this.node);
+}
+
+static void client_node_free(void *data)
+{
+ struct impl *impl = data;
+ pw_log_debug("client-stream %p: free", &impl->this);
+ spa_hook_remove(&impl->client_node_listener);
cleanup(impl);
}
@@ -1138,21 +1144,26 @@ static void client_node_info_changed(void *data, const struct pw_node_info *info
static const struct pw_node_events client_node_events = {
PW_VERSION_NODE_EVENTS,
.destroy = client_node_destroy,
+ .free = client_node_free,
.initialized = client_node_initialized,
.result = client_node_result,
.active_changed = client_node_active_changed,
.info_changed = client_node_info_changed,
};
-static void node_free(void *data)
+static void node_destroy(void *data)
{
struct impl *impl = data;
+ pw_log_debug("client-stream %p: destroy", &impl->this);
+ spa_hook_remove(&impl->client_node_listener);
+ pw_client_node_destroy(impl->client_node);
+}
+static void node_free(void *data)
+{
+ struct impl *impl = data;
pw_log_debug("client-stream %p: free", &impl->this);
-
spa_hook_remove(&impl->node_listener);
- spa_hook_remove(&impl->client_node_listener);
- pw_client_node_destroy(impl->client_node);
cleanup(impl);
}
@@ -1184,6 +1195,7 @@ static void node_driver_changed(void *data, struct pw_node *old, struct pw_node
static const struct pw_node_events node_events = {
PW_VERSION_NODE_EVENTS,
+ .destroy = node_destroy,
.free = node_free,
.initialized = node_initialized,
.peer_added = node_peer_added,