gstbin: Fix a potential leak in gst_bin_do_deep_add_remove()

If a child element of a bin is unparented while
gst_bin_do_deep_add_remove() is iterating the children,
don't leak a ref to it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3101>
This commit is contained in:
Jan Schmidt 2022-10-01 04:55:49 +10:00 committed by GStreamer Marge Bot
parent b7b4d93452
commit 8f91f1efe4

View file

@ -1142,8 +1142,9 @@ gst_bin_do_deep_add_remove (GstBin * bin, gint sig_id, const gchar * sig_name,
" in bin %" GST_PTR_FORMAT, sig_name, e, parent);
g_signal_emit (bin, sig_id, 0, parent, e);
gst_object_unref (parent);
gst_object_unref (e);
}
gst_object_unref (e);
}
}
gst_iterator_free (it);