player: Don't leak wrapped video info
authorSebastian Dröge <sebastian@centricular.com>
Sat, 13 Aug 2022 09:24:37 +0000 (12:24 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Sat, 13 Aug 2022 09:24:37 +0000 (12:24 +0300)
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1373

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2880>

subprojects/gst-plugins-bad/gst-libs/gst/player/gstplayer-media-info.c

index f2af40b..36eb14c 100644 (file)
@@ -149,9 +149,21 @@ gst_player_video_info_init (G_GNUC_UNUSED GstPlayerVideoInfo * info)
 }
 
 static void
+gst_player_video_info_finalize (GObject * object)
+{
+  GstPlayerVideoInfo *info = GST_PLAYER_VIDEO_INFO (object);
+
+  g_clear_object (&info->info);
+
+  G_OBJECT_CLASS (gst_player_video_info_parent_class)->finalize (object);
+}
+
+static void
 gst_player_video_info_class_init (G_GNUC_UNUSED GstPlayerVideoInfoClass * klass)
 {
-  /* nothing to do here */
+  GObjectClass *gobject_class = (GObjectClass *) klass;
+
+  gobject_class->finalize = gst_player_video_info_finalize;
 }
 
 /**