gst-play: Don't leak the stream collection

We are given a reference to the collection when parsing it from the
message. Just store it (instead of referencing it again).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3186>
This commit is contained in:
Edward Hervey 2022-10-14 16:12:45 +02:00 committed by GStreamer Marge Bot
parent b10e0efd3a
commit ece84d69a2

View file

@ -620,8 +620,9 @@ play_bus_msg (GstBus * bus, GstMessage * msg, gpointer user_data)
if (collection) {
g_mutex_lock (&play->selection_lock);
gst_object_replace ((GstObject **) & play->collection,
(GstObject *) collection);
if (play->collection)
gst_object_unref (play->collection);
play->collection = collection;
g_mutex_unlock (&play->selection_lock);
}
break;