vah265enc: Fix a memory leak when destroying the object

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6791>
This commit is contained in:
He Junyan 2024-05-03 22:57:57 +08:00 committed by GStreamer Marge Bot
parent f340429681
commit ae989e8cee

View file

@ -5002,6 +5002,19 @@ gst_va_h265_enc_get_property (GObject * object, guint prop_id,
GST_OBJECT_UNLOCK (self);
}
static void
gst_va_h265_enc_dispose (GObject * object)
{
GstVaH265Enc *self = GST_VA_H265_ENC (object);
g_clear_pointer (&self->partition.slice_segment_address, g_free);
g_clear_pointer (&self->partition.num_ctu_in_slice, g_free);
g_clear_pointer (&self->partition.tile_ctu_cols, g_free);
g_clear_pointer (&self->partition.tile_ctu_rows, g_free);
G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void
gst_va_h265_enc_class_init (gpointer g_klass, gpointer class_data)
{
@ -5062,6 +5075,7 @@ gst_va_h265_enc_class_init (gpointer g_klass, gpointer class_data)
object_class->set_property = gst_va_h265_enc_set_property;
object_class->get_property = gst_va_h265_enc_get_property;
object_class->dispose = gst_va_h265_enc_dispose;
venc_class->flush = GST_DEBUG_FUNCPTR (gst_va_h265_enc_flush);
venc_class->start = GST_DEBUG_FUNCPTR (gst_va_h265_enc_start);