From 67caa45a4c0f2f2c89823fee8f1c39dc853b0442 Mon Sep 17 00:00:00 2001 From: Aleksandr Slobodeniuk Date: Thu, 6 Oct 2022 13:03:26 +0200 Subject: [PATCH] decodebin3: fix mutex leaks Part-of: --- subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c b/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c index 0497f3e..05db874 100644 --- a/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c +++ b/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c @@ -471,6 +471,7 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src_%u", static void gst_decodebin3_dispose (GObject * object); +static void gst_decodebin3_finalize (GObject * object); static void gst_decodebin3_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_decodebin3_get_property (GObject * object, guint prop_id, @@ -553,6 +554,7 @@ gst_decodebin3_class_init (GstDecodebin3Class * klass) GstBinClass *bin_klass = (GstBinClass *) klass; gobject_klass->dispose = gst_decodebin3_dispose; + gobject_klass->finalize = gst_decodebin3_finalize; gobject_klass->set_property = gst_decodebin3_set_property; gobject_klass->get_property = gst_decodebin3_get_property; @@ -682,6 +684,18 @@ gst_decodebin3_dispose (GObject * object) } static void +gst_decodebin3_finalize (GObject * object) +{ + GstDecodebin3 *dbin = (GstDecodebin3 *) object; + + g_mutex_clear (&dbin->factories_lock); + g_mutex_clear (&dbin->selection_lock); + g_mutex_clear (&dbin->input_lock); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + +static void gst_decodebin3_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { -- 2.7.4