decodebin3: Free main input even if it is not part of the list of inputs

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8216>
This commit is contained in:
Sebastian Dröge 2024-12-27 14:27:54 +02:00 committed by GStreamer Marge Bot
parent 126d6f0815
commit f0a8938133

View file

@ -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);