diff --git a/ChangeLog b/ChangeLog index ffa5ea1c24..b2b68c10f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-08-17 Stefan Kost + + * ext/amrnb/amrnbdec.c: + * ext/amrnb/amrnbenc.c: + * ext/amrnb/amrnbparse.c: + * ext/sidplay/gstsiddec.cc: + Fix more leaks. + 2007-08-16 Wim Taymans Patch by: Daniel Charles diff --git a/ext/amrnb/amrnbdec.c b/ext/amrnb/amrnbdec.c index e8ae86bb46..1f6ff87681 100644 --- a/ext/amrnb/amrnbdec.c +++ b/ext/amrnb/amrnbdec.c @@ -222,7 +222,6 @@ gst_amrnbdec_event (GstPad * pad, GstEvent * event) ret = gst_pad_push_event (amrnbdec->srcpad, event); } break; - break; default: ret = gst_pad_push_event (amrnbdec->srcpad, event); break; diff --git a/ext/amrnb/amrnbparse.c b/ext/amrnb/amrnbparse.c index fbae346e65..32d67cb355 100644 --- a/ext/amrnb/amrnbparse.c +++ b/ext/amrnb/amrnbparse.c @@ -73,6 +73,8 @@ static gboolean gst_amrnbparse_sink_activate_pull (GstPad * sinkpad, static GstStateChangeReturn gst_amrnbparse_state_change (GstElement * element, GstStateChange transition); +static void gst_amrnbparse_finalize (GObject * object); + #define _do_init(bla) \ GST_DEBUG_CATEGORY_INIT (gst_amrnbparse_debug, "amrnbparse", 0, "AMR-NB audio stream parser"); @@ -99,8 +101,11 @@ gst_amrnbparse_base_init (gpointer klass) static void gst_amrnbparse_class_init (GstAmrnbParseClass * klass) { + GObjectClass *object_class = G_OBJECT_CLASS (klass); GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + object_class->finalize = gst_amrnbparse_finalize; + element_class->change_state = GST_DEBUG_FUNCPTR (gst_amrnbparse_state_change); } @@ -135,6 +140,20 @@ gst_amrnbparse_init (GstAmrnbParse * amrnbparse, GstAmrnbParseClass * klass) amrnbparse->ts = 0; } +static void +gst_amrnbparse_finalize (GObject * object) +{ + GstAmrnbParse *amrnbparse; + + amrnbparse = GST_AMRNBPARSE (object); + + gst_adapter_clear (amrnbparse->adapter); + g_object_unref (amrnbparse->adapter); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + + /* * Position querying. */ diff --git a/ext/sidplay/gstsiddec.cc b/ext/sidplay/gstsiddec.cc index 8f9e7e1376..4ee2be475c 100644 --- a/ext/sidplay/gstsiddec.cc +++ b/ext/sidplay/gstsiddec.cc @@ -254,17 +254,13 @@ gst_siddec_class_init (GstSidDec * klass) static void gst_siddec_init (GstSidDec * siddec) { - siddec->sinkpad = - gst_pad_new_from_template (gst_static_pad_template_get (&sink_templ), - "sink"); + siddec->sinkpad = gst_pad_new_from_static_template (&sink_templ, "sink"); gst_pad_set_query_function (siddec->sinkpad, NULL); gst_pad_set_event_function (siddec->sinkpad, gst_siddec_sink_event); gst_pad_set_chain_function (siddec->sinkpad, gst_siddec_chain); gst_element_add_pad (GST_ELEMENT (siddec), siddec->sinkpad); - siddec->srcpad = - gst_pad_new_from_template (gst_static_pad_template_get (&src_templ), - "src"); + siddec->srcpad = gst_pad_new_from_static_template (&src_templ, "src"); gst_pad_set_event_function (siddec->srcpad, gst_siddec_src_event); gst_pad_set_query_function (siddec->srcpad, gst_siddec_src_query); gst_pad_use_fixed_caps (siddec->srcpad);