From 42418bece59d8325a2e627877a35408bbdad5b2b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 18 Oct 2023 18:51:48 +0200 Subject: [PATCH] impl: destroy node and device in global free Destroy the node and device in the global free event. This way, the global resources are already destroyed and we have removed their ref to the spa node before we destroy that. Fixes #3588 --- src/pipewire/impl-device.c | 4 ++-- src/pipewire/impl-node.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pipewire/impl-device.c b/src/pipewire/impl-device.c index bf9e9aac6..af85b6a28 100644 --- a/src/pipewire/impl-device.c +++ b/src/pipewire/impl-device.c @@ -520,7 +520,7 @@ error_resource: return -errno; } -static void global_destroy(void *data) +static void global_free(void *data) { struct pw_impl_device *device = data; spa_hook_remove(&device->global_listener); @@ -530,7 +530,7 @@ static void global_destroy(void *data) static const struct pw_global_events global_events = { PW_VERSION_GLOBAL_EVENTS, - .destroy = global_destroy, + .free = global_free, }; SPA_EXPORT diff --git a/src/pipewire/impl-node.c b/src/pipewire/impl-node.c index 6bfa26b16..7061646ad 100644 --- a/src/pipewire/impl-node.c +++ b/src/pipewire/impl-node.c @@ -669,7 +669,7 @@ error_resource: return -errno; } -static void global_destroy(void *data) +static void global_free(void *data) { struct pw_impl_node *this = data; spa_hook_remove(&this->global_listener); @@ -679,7 +679,7 @@ static void global_destroy(void *data) static const struct pw_global_events global_events = { PW_VERSION_GLOBAL_EVENTS, - .destroy = global_destroy, + .free = global_free, }; static inline void insert_driver(struct pw_context *context, struct pw_impl_node *node)