ext/: Fix more leaks.

Original commit message from CVS:
* ext/amrnb/amrnbdec.c:
* ext/amrnb/amrnbenc.c:
* ext/amrnb/amrnbparse.c:
* ext/sidplay/gstsiddec.cc:
Fix more leaks.
This commit is contained in:
Stefan Kost 2007-08-17 06:56:53 +00:00
parent cabd62c45b
commit 867ce5c3a6
4 changed files with 29 additions and 7 deletions

View file

@ -1,3 +1,11 @@
2007-08-17 Stefan Kost <ensonic@users.sf.net>
* ext/amrnb/amrnbdec.c:
* ext/amrnb/amrnbenc.c:
* ext/amrnb/amrnbparse.c:
* ext/sidplay/gstsiddec.cc:
Fix more leaks.
2007-08-16 Wim Taymans <wim.taymans@gmail.com>
Patch by: Daniel Charles <dcharles at ti dot com>

View file

@ -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;

View file

@ -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.
*/

View file

@ -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);