mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
module-spa: remove the listeners correctly
In the module destroy, remove the module listener and in the factory_destroy, the factory_listener.
This commit is contained in:
parent
42319e32be
commit
6317bc4deb
1 changed files with 5 additions and 3 deletions
|
|
@ -192,10 +192,10 @@ static void factory_destroy(void *_data)
|
||||||
struct factory_data *data = _data;
|
struct factory_data *data = _data;
|
||||||
struct node_data *nd;
|
struct node_data *nd;
|
||||||
|
|
||||||
spa_hook_remove(&data->module_listener);
|
spa_hook_remove(&data->factory_listener);
|
||||||
|
|
||||||
spa_list_consume(nd, &data->node_list, link)
|
spa_list_consume(nd, &data->node_list, link)
|
||||||
pw_impl_node_destroy(nd->node);
|
pw_impl_node_destroy(nd->node);
|
||||||
|
data->this = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct pw_impl_factory_events factory_events = {
|
static const struct pw_impl_factory_events factory_events = {
|
||||||
|
|
@ -206,6 +206,8 @@ static const struct pw_impl_factory_events factory_events = {
|
||||||
static void module_destroy(void *_data)
|
static void module_destroy(void *_data)
|
||||||
{
|
{
|
||||||
struct factory_data *data = _data;
|
struct factory_data *data = _data;
|
||||||
|
spa_hook_remove(&data->module_listener);
|
||||||
|
if (data->this)
|
||||||
pw_impl_factory_destroy(data->this);
|
pw_impl_factory_destroy(data->this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue