mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-15 08:56:38 -05:00
gst: fix proxy leaks
This commit is contained in:
parent
61c1fe546e
commit
cd7a56a71c
1 changed files with 21 additions and 1 deletions
|
|
@ -404,6 +404,13 @@ static const struct pw_node_events node_events = {
|
||||||
.info = node_event_info
|
.info = node_event_info
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void
|
||||||
|
removed_node (void *data)
|
||||||
|
{
|
||||||
|
struct node_data *nd = data;
|
||||||
|
pw_proxy_destroy((struct pw_proxy*)nd->proxy);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
destroy_node (void *data)
|
destroy_node (void *data)
|
||||||
{
|
{
|
||||||
|
|
@ -428,9 +435,17 @@ destroy_node (void *data)
|
||||||
|
|
||||||
static const struct pw_proxy_events proxy_node_events = {
|
static const struct pw_proxy_events proxy_node_events = {
|
||||||
PW_VERSION_PROXY_EVENTS,
|
PW_VERSION_PROXY_EVENTS,
|
||||||
|
.removed = removed_node,
|
||||||
.destroy = destroy_node,
|
.destroy = destroy_node,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void
|
||||||
|
removed_port (void *data)
|
||||||
|
{
|
||||||
|
struct port_data *pd = data;
|
||||||
|
pw_proxy_destroy((struct pw_proxy*)pd->proxy);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
destroy_port (void *data)
|
destroy_port (void *data)
|
||||||
{
|
{
|
||||||
|
|
@ -442,6 +457,7 @@ destroy_port (void *data)
|
||||||
|
|
||||||
static const struct pw_proxy_events proxy_port_events = {
|
static const struct pw_proxy_events proxy_port_events = {
|
||||||
PW_VERSION_PROXY_EVENTS,
|
PW_VERSION_PROXY_EVENTS,
|
||||||
|
.removed = removed_port,
|
||||||
.destroy = destroy_port,
|
.destroy = destroy_port,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -563,6 +579,7 @@ gst_pipewire_device_provider_probe (GstDeviceProvider * provider)
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self, "disconnect");
|
GST_DEBUG_OBJECT (self, "disconnect");
|
||||||
|
pw_proxy_destroy ((struct pw_proxy*)data->registry);
|
||||||
pw_core_disconnect (self->core);
|
pw_core_disconnect (self->core);
|
||||||
pw_context_destroy (c);
|
pw_context_destroy (c);
|
||||||
pw_loop_destroy (l);
|
pw_loop_destroy (l);
|
||||||
|
|
@ -654,7 +671,10 @@ gst_pipewire_device_provider_stop (GstDeviceProvider * provider)
|
||||||
GstPipeWireDeviceProvider *self = GST_PIPEWIRE_DEVICE_PROVIDER (provider);
|
GstPipeWireDeviceProvider *self = GST_PIPEWIRE_DEVICE_PROVIDER (provider);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self, "stopping provider");
|
GST_DEBUG_OBJECT (self, "stopping provider");
|
||||||
|
if (self->registry) {
|
||||||
|
pw_proxy_destroy ((struct pw_proxy*)self->registry);
|
||||||
|
self->registry = NULL;
|
||||||
|
}
|
||||||
if (self->core) {
|
if (self->core) {
|
||||||
pw_core_disconnect (self->core);
|
pw_core_disconnect (self->core);
|
||||||
self->core = NULL;
|
self->core = NULL;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue