mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-09-20 00:11:31 +00:00
module-session-manager: don't leak the impl structure
We need to remove the listener for the object as well so that we can safely free the impl memory.
This commit is contained in:
parent
2112a7287b
commit
3509962f3a
|
@ -221,6 +221,7 @@ static void global_destroy(void *data)
|
||||||
impl->global = NULL;
|
impl->global = NULL;
|
||||||
if (impl->resource)
|
if (impl->resource)
|
||||||
pw_resource_destroy(impl->resource);
|
pw_resource_destroy(impl->resource);
|
||||||
|
free(impl);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct pw_global_events global_events = {
|
static const struct pw_global_events global_events = {
|
||||||
|
@ -234,6 +235,7 @@ static void impl_resource_destroy(void *data)
|
||||||
struct param_data *pdata, *tmp;
|
struct param_data *pdata, *tmp;
|
||||||
|
|
||||||
spa_hook_remove(&impl->resource_listener);
|
spa_hook_remove(&impl->resource_listener);
|
||||||
|
spa_hook_remove(&impl->link_listener);
|
||||||
impl->resource = NULL;
|
impl->resource = NULL;
|
||||||
|
|
||||||
/* clear cache */
|
/* clear cache */
|
||||||
|
|
|
@ -212,6 +212,7 @@ static void global_destroy(void *data)
|
||||||
impl->global = NULL;
|
impl->global = NULL;
|
||||||
if (impl->resource)
|
if (impl->resource)
|
||||||
pw_resource_destroy(impl->resource);
|
pw_resource_destroy(impl->resource);
|
||||||
|
free(impl);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct pw_global_events global_events = {
|
static const struct pw_global_events global_events = {
|
||||||
|
@ -225,6 +226,7 @@ static void impl_resource_destroy(void *data)
|
||||||
struct param_data *pdata, *tmp;
|
struct param_data *pdata, *tmp;
|
||||||
|
|
||||||
spa_hook_remove(&impl->resource_listener);
|
spa_hook_remove(&impl->resource_listener);
|
||||||
|
spa_hook_remove(&impl->stream_listener);
|
||||||
impl->resource = NULL;
|
impl->resource = NULL;
|
||||||
|
|
||||||
/* clear cache */
|
/* clear cache */
|
||||||
|
|
|
@ -221,6 +221,7 @@ static void global_destroy(void *data)
|
||||||
impl->global = NULL;
|
impl->global = NULL;
|
||||||
if (impl->resource)
|
if (impl->resource)
|
||||||
pw_resource_destroy(impl->resource);
|
pw_resource_destroy(impl->resource);
|
||||||
|
free(impl);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct pw_global_events global_events = {
|
static const struct pw_global_events global_events = {
|
||||||
|
@ -234,6 +235,7 @@ static void impl_resource_destroy(void *data)
|
||||||
struct param_data *pdata, *tmp;
|
struct param_data *pdata, *tmp;
|
||||||
|
|
||||||
spa_hook_remove(&impl->resource_listener);
|
spa_hook_remove(&impl->resource_listener);
|
||||||
|
spa_hook_remove(&impl->endpoint_listener);
|
||||||
impl->resource = NULL;
|
impl->resource = NULL;
|
||||||
|
|
||||||
/* clear cache */
|
/* clear cache */
|
||||||
|
|
Loading…
Reference in a new issue