From 47dbdea469faa0ba816bc2e46d90362514f65857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Sj=C3=B6lund?= Date: Wed, 27 Sep 2023 08:48:03 +0200 Subject: [PATCH] souphttpsrc: Chain finalize call to parent GstSoupSession finalize does not chain parent finalize, causing it to leak memory, shown under g freeze notify. In finalize method, ensure all branches call to parent finalize. Part-of: --- subprojects/gst-plugins-good/ext/soup/gstsouphttpsrc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-good/ext/soup/gstsouphttpsrc.c b/subprojects/gst-plugins-good/ext/soup/gstsouphttpsrc.c index cd74ac1a9f..04cb70e360 100644 --- a/subprojects/gst-plugins-good/ext/soup/gstsouphttpsrc.c +++ b/subprojects/gst-plugins-good/ext/soup/gstsouphttpsrc.c @@ -96,6 +96,7 @@ #define GST_TYPE_SOUP_SESSION (gst_soup_session_get_type()) #define GST_SOUP_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_SOUP_SESSION, GstSoupSession)) +#define gst_soup_session_parent_class session_parent_class GType gst_soup_session_get_type (void); @@ -139,8 +140,9 @@ gst_soup_session_finalize (GObject * obj) GSource *src; /* handle disposing of failure cases */ - if (!sess->loop) - return; + if (!sess->loop) { + goto cleanup; + } src = g_idle_source_new (); @@ -152,6 +154,8 @@ gst_soup_session_finalize (GObject * obj) g_assert (!g_main_context_is_owner (g_main_loop_get_context (sess->loop))); g_thread_join (sess->thread); g_main_loop_unref (sess->loop); +cleanup: + G_OBJECT_CLASS (session_parent_class)->finalize (obj); } static void