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
This commit is contained in:
Wim Taymans 2023-10-18 18:51:48 +02:00
parent c9c98312cb
commit 42418bece5
2 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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)