msdkdec: call finalize on the parent class
authorJulien Isorce <jisorce@oblong.com>
Fri, 13 Dec 2019 23:33:06 +0000 (15:33 -0800)
committerJulien Isorce <jisorce@oblong.com>
Fri, 13 Dec 2019 23:36:26 +0000 (15:36 -0800)
Otherwise GstVideoDecoder is not finalized and
resources are leaked.

Somehow GST_TRACERS="leaks" GST_DEBUG="GST_TRACER:7" did not catch it.

Valgrind output:

==31645== 22,480 (1,400 direct, 21,080 indirect) bytes in 5 blocks are definitely lost in loss record 5,042 of 5,049
==31645==    at 0x4C2FB0F: malloc
==31645==    by 0x51D9E88: g_malloc
==31645==    by 0x51FA7B5: g_slice_alloc
==31645==    by 0x51FAC68: g_slice_alloc0
==31645==    by 0x58D9984: g_type_create_instance
==31645==    by 0x58BA344: g_object_new_with_properties
==31645==    by 0x58BADA0: g_object_new
==31645==    by 0x8ECA966: gst_video_decoder_init
==31645==    by 0x58D99E7: g_type_create_instance
==31645==    by 0x58BA344: g_object_new_with_properties

sys/msdk/gstmsdkdec.c

index 7277bc3..e723787 100644 (file)
@@ -1579,6 +1579,8 @@ gst_msdkdec_finalize (GObject * object)
     GST_ERROR_OBJECT (thiz, "leaking %u surfaces",
         g_list_length (thiz->decoded_msdk_surfaces));
   }
+
+  G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 static gboolean