From 6fff1ef971fd34e423ffaf7ef71682c9ea5e044a Mon Sep 17 00:00:00 2001 From: Robert Rosengren Date: Mon, 18 Nov 2024 08:47:12 +0100 Subject: [PATCH] gstdeviceprovider: fix leaking hidden providers Free list of hidden providers upon stop and dispose. Part-of: --- subprojects/gstreamer/gst/gstdeviceprovider.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subprojects/gstreamer/gst/gstdeviceprovider.c b/subprojects/gstreamer/gst/gstdeviceprovider.c index 3e9c0bf1e2..a847570fa6 100644 --- a/subprojects/gstreamer/gst/gstdeviceprovider.c +++ b/subprojects/gstreamer/gst/gstdeviceprovider.c @@ -179,8 +179,8 @@ gst_device_provider_dispose (GObject * object) gst_object_replace ((GstObject **) & provider->priv->bus, NULL); GST_OBJECT_LOCK (provider); - g_list_free_full (provider->devices, (GDestroyNotify) gst_object_unparent); - provider->devices = NULL; + g_clear_list (&provider->devices, (GDestroyNotify) gst_object_unparent); + g_clear_list (&provider->priv->hidden_providers, (GDestroyNotify) g_free); GST_OBJECT_UNLOCK (provider); G_OBJECT_CLASS (gst_device_provider_parent_class)->dispose (object); @@ -534,8 +534,8 @@ gst_device_provider_stop (GstDeviceProvider * provider) if (klass->stop) klass->stop (provider); GST_OBJECT_LOCK (provider); - g_list_free_full (provider->devices, (GDestroyNotify) gst_object_unparent); - provider->devices = NULL; + g_clear_list (&provider->devices, (GDestroyNotify) gst_object_unparent); + g_clear_list (&provider->priv->hidden_providers, (GDestroyNotify) g_free); GST_OBJECT_UNLOCK (provider); } else if (provider->priv->started_count < 1) { g_critical