From f0a8938133ec8746f1430406e22801112aa88cf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 27 Dec 2024 14:27:54 +0200 Subject: [PATCH] decodebin3: Free main input even if it is not part of the list of inputs Part-of: --- .../gst-plugins-base/gst/playback/gstdecodebin3.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c b/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c index 399a29523c..87491cc0b0 100644 --- a/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c +++ b/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c @@ -794,8 +794,17 @@ gst_decodebin3_dispose (GObject * object) g_mutex_unlock (&dbin->factories_lock); INPUT_LOCK (dbin); - g_list_free_full (dbin->inputs, (GDestroyNotify) gst_decodebin_input_free); + while (dbin->inputs) { + DecodebinInput *input = dbin->inputs->data; + if (input->is_main) + dbin->main_input = NULL; + gst_decodebin_input_free (input); + + dbin->inputs = g_list_delete_link (dbin->inputs, dbin->inputs); + } dbin->inputs = NULL; + if (dbin->main_input) + gst_decodebin_input_free (dbin->main_input); dbin->main_input = NULL; INPUT_UNLOCK (dbin);