diff --git a/sys/nvcodec/gstnvdec.c b/sys/nvcodec/gstnvdec.c index 4bf4abefa0..6a4d10238a 100644 --- a/sys/nvcodec/gstnvdec.c +++ b/sys/nvcodec/gstnvdec.c @@ -1413,6 +1413,9 @@ gst_nvdec_subclass_register (GstPlugin * plugin, GType type, cdata->codec_type = codec_type; cdata->codec = g_strdup (codec); cdata->cuda_device_id = device_id; + /* class data will be leaked if the element never gets instantiated */ + GST_MINI_OBJECT_FLAG_SET (sink_caps, GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED); + GST_MINI_OBJECT_FLAG_SET (src_caps, GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED); g_type_query (type, &type_query); memset (&type_info, 0, sizeof (type_info)); diff --git a/sys/nvcodec/gstnvh264enc.c b/sys/nvcodec/gstnvh264enc.c index 242e3b6242..b1bceeb477 100644 --- a/sys/nvcodec/gstnvh264enc.c +++ b/sys/nvcodec/gstnvh264enc.c @@ -643,6 +643,9 @@ gst_nv_h264_enc_register (GstPlugin * plugin, guint device_id, guint rank, cdata->sink_caps = gst_caps_ref (sink_caps); cdata->src_caps = gst_caps_ref (src_caps); type_info.class_data = cdata; + /* class data will be leaked if the element never gets instantiated */ + GST_MINI_OBJECT_FLAG_SET (sink_caps, GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED); + GST_MINI_OBJECT_FLAG_SET (src_caps, GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED); type_name = g_strdup ("GstNvH264Enc"); feature_name = g_strdup ("nvh264enc"); diff --git a/sys/nvcodec/gstnvh265enc.c b/sys/nvcodec/gstnvh265enc.c index 4a1e716e0a..5d7d032dfe 100644 --- a/sys/nvcodec/gstnvh265enc.c +++ b/sys/nvcodec/gstnvh265enc.c @@ -798,6 +798,9 @@ gst_nv_h265_enc_register (GstPlugin * plugin, guint device_id, guint rank, cdata->sink_caps = gst_caps_ref (sink_caps); cdata->src_caps = gst_caps_ref (src_caps); type_info.class_data = cdata; + /* class data will be leaked if the element never gets instantiated */ + GST_MINI_OBJECT_FLAG_SET (sink_caps, GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED); + GST_MINI_OBJECT_FLAG_SET (src_caps, GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED); type_name = g_strdup ("GstNvH265Enc"); feature_name = g_strdup ("nvh265enc");