From 1af510f8d54ddeb58f1c8e6db3f4fe45d21dd026 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Mon, 24 Sep 2007 10:53:37 +0000 Subject: Massive leak fixing, plus code cleanups. Original commit message from CVS: * ext/audioresample/gstaudioresample.c: * ext/x264/gstx264enc.c: * gst/dvdspu/gstdvdspu.c: * gst/dvdspu/gstdvdspu.h: * gst/festival/gstfestival.c: * gst/h264parse/gsth264parse.c: * gst/mpegtsparse/mpegtspacketizer.c: * gst/mpegtsparse/mpegtsparse.c: * gst/multifile/gstmultifilesink.c: * gst/multifile/gstmultifilesrc.c: * gst/nuvdemux/gstnuvdemux.c: * sys/dshowsrcwrapper/gstdshowaudiosrc.c: * sys/dshowsrcwrapper/gstdshowvideosrc.c: * sys/vcd/vcdsrc.c: Massive leak fixing, plus code cleanups. --- gst/festival/gstfestival.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'gst/festival') diff --git a/gst/festival/gstfestival.c b/gst/festival/gstfestival.c index 0d8395c9..7a147c95 100644 --- a/gst/festival/gstfestival.c +++ b/gst/festival/gstfestival.c @@ -97,6 +97,8 @@ GST_DEBUG_CATEGORY_STATIC (festival_debug); #define GST_CAT_DEFAULT festival_debug +static void gst_festival_finalize (GObject * object); + static void gst_festival_base_init (gpointer g_class); static void gst_festival_class_init (GstFestivalClass * klass); static void gst_festival_init (GstFestival * festival); @@ -189,13 +191,17 @@ gst_festival_base_init (gpointer g_class) static void gst_festival_class_init (GstFestivalClass * klass) { + GObjectClass *gobject_class; GstElementClass *gstelement_class; - gstelement_class = (GstElementClass *) klass; + gobject_class = G_OBJECT_CLASS (klass); + gstelement_class = GST_ELEMENT_CLASS (klass); parent_class = g_type_class_peek_parent (klass); - gstelement_class->change_state = gst_festival_change_state; + gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_festival_finalize); + gstelement_class->change_state = + GST_DEBUG_FUNCPTR (gst_festival_change_state); } static void @@ -213,6 +219,16 @@ gst_festival_init (GstFestival * festival) festival->info = festival_default_info (); } +static void +gst_festival_finalize (GObject * object) +{ + GstFestival *festival = GST_FESTIVAL (object); + + g_free (festival->info); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + static gboolean read_response (GstFestival * festival) { -- cgit v1.2.1