vah265enc: Fix a memory leak when destroying the object

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6913>
This commit is contained in:
He Junyan 2024-05-03 22:57:57 +08:00 committed by Backport Bot
parent 2dd3ce721a
commit 77455b50d3

View file

@ -4941,6 +4941,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)
{
@ -5001,6 +5014,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);