summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sourceforge.net>2007-08-17 06:55:37 +0000
committerStefan Kost <ensonic@users.sourceforge.net>2007-08-17 06:55:37 +0000
commit03afa9b296733bd745f5dd66a15f56aa11a95433 (patch)
tree17995a8a5833fb2dc61e2fbfa999ce433a303341
parente221638fdd642bdf8b4a86365d8a873e89ca9e46 (diff)
downloadgst-plugins-bad-03afa9b296733bd745f5dd66a15f56aa11a95433.tar.gz
gst-plugins-bad-03afa9b296733bd745f5dd66a15f56aa11a95433.tar.bz2
gst-plugins-bad-03afa9b296733bd745f5dd66a15f56aa11a95433.zip
ext/amrwb/gstamrwbparse.c: Don't leak the adapter.
Original commit message from CVS: * ext/amrwb/gstamrwbparse.c: Don't leak the adapter.
-rw-r--r--ChangeLog5
-rw-r--r--ext/amrwb/gstamrwbparse.c19
2 files changed, 24 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 09ac317d..c74f1140 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-08-17 Stefan Kost <ensonic@users.sf.net>
+
+ * ext/amrwb/gstamrwbparse.c:
+ Don't leak the adapter.
+
2007-08-16 Sebastian Dröge <slomo@circular-chaos.org>
* gst/filter/gstbpwsinc.c: (gst_bpwsinc_class_init),
diff --git a/ext/amrwb/gstamrwbparse.c b/ext/amrwb/gstamrwbparse.c
index 2054fc25..f7a7e274 100644
--- a/ext/amrwb/gstamrwbparse.c
+++ b/ext/amrwb/gstamrwbparse.c
@@ -75,6 +75,8 @@ static gboolean gst_amrwbparse_sink_activate_pull (GstPad * sinkpad,
static GstStateChangeReturn gst_amrwbparse_state_change (GstElement * element,
GstStateChange transition);
+static void gst_amrwbparse_finalize (GObject * object);
+
#define _do_init(bla) \
GST_DEBUG_CATEGORY_INIT (gst_amrwbparse_debug, "amrwbparse", 0, "AMR-WB audio stream parser");
@@ -102,8 +104,11 @@ gst_amrwbparse_base_init (gpointer klass)
static void
gst_amrwbparse_class_init (GstAmrwbParseClass * klass)
{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
+ object_class->finalize = gst_amrwbparse_finalize;
+
element_class->change_state = GST_DEBUG_FUNCPTR (gst_amrwbparse_state_change);
}
@@ -137,6 +142,20 @@ gst_amrwbparse_init (GstAmrwbParse * amrwbparse, GstAmrwbParseClass * klass)
amrwbparse->ts = 0;
}
+static void
+gst_amrwbparse_finalize (GObject * object)
+{
+ GstAmrwbParse *amrwbparse;
+
+ amrwbparse = GST_AMRWBPARSE (object);
+
+ gst_adapter_clear (amrwbparse->adapter);
+ g_object_unref (amrwbparse->adapter);
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+
static const GstQueryType *
gst_amrwbparse_querytypes (GstPad * pad)
{