From ece84d69a29ccd09485ce11f0285a3ebe39e4b74 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Fri, 14 Oct 2022 16:12:45 +0200 Subject: [PATCH] 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: --- subprojects/gst-plugins-base/tools/gst-play.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-base/tools/gst-play.c b/subprojects/gst-plugins-base/tools/gst-play.c index 3025e04073..c66c77adee 100644 --- a/subprojects/gst-plugins-base/tools/gst-play.c +++ b/subprojects/gst-plugins-base/tools/gst-play.c @@ -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;