From 8a44792254d5e124cf70398bc65ff93b05e164aa Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 10 Jan 2006 12:38:59 +0000 Subject: [PATCH] gst/level/gstlevel.c: Don't leak filter arrays. Original commit message from CVS: * gst/level/gstlevel.c: (gst_level_class_init), (gst_level_dispose): Don't leak filter arrays. --- ChangeLog | 6 ++++++ gst/level/gstlevel.c | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/ChangeLog b/ChangeLog index a5c9949..248d0f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-01-10 Michael Smith + + * gst/level/gstlevel.c: (gst_level_class_init), + (gst_level_dispose): + Don't leak filter arrays. + 2006-01-09 Brian Cameron reviewed by: Christian Schaller diff --git a/gst/level/gstlevel.c b/gst/level/gstlevel.c index 6bb53dd..26afb08 100644 --- a/gst/level/gstlevel.c +++ b/gst/level/gstlevel.c @@ -133,6 +133,7 @@ static void gst_level_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_level_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); +static void gst_level_dispose (GObject * obj); static gboolean gst_level_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out); @@ -163,6 +164,7 @@ gst_level_class_init (GstLevelClass * klass) gobject_class->set_property = gst_level_set_property; gobject_class->get_property = gst_level_get_property; + gobject_class->dispose = gst_level_dispose; g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SIGNAL_LEVEL, g_param_spec_boolean ("message", "mesage", @@ -206,6 +208,28 @@ gst_level_init (GstLevel * filter, GstLevelClass * g_class) } static void +gst_level_dispose (GObject * obj) +{ + GstLevel *filter = GST_LEVEL (obj); + + g_free (filter->CS); + g_free (filter->peak); + g_free (filter->last_peak); + g_free (filter->decay_peak); + g_free (filter->decay_peak_base); + g_free (filter->decay_peak_age); + + filter->CS = NULL; + filter->peak = NULL; + filter->last_peak = NULL; + filter->decay_peak = NULL; + filter->decay_peak_base = NULL; + filter->decay_peak_age = NULL; + + G_OBJECT_CLASS (parent_class)->dispose (obj); +} + +static void gst_level_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { -- 2.7.4