mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
ext/amrnb/amrnbdec.c: Don't leak the adapter, unref it in a new finalize method instead.
Original commit message from CVS: Patch by: Laurent Glayal <spglegle at yahoo dot fr> * ext/amrnb/amrnbdec.c: (gst_amrnbdec_class_init), (gst_amrnbdec_finalize): Don't leak the adapter, unref it in a new finalize method instead. Fixes #448782.
This commit is contained in:
parent
3692373654
commit
3c563fd3ae
2 changed files with 27 additions and 0 deletions
|
@ -1,3 +1,12 @@
|
|||
2007-06-19 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
Patch by: Laurent Glayal <spglegle at yahoo dot fr>
|
||||
|
||||
* ext/amrnb/amrnbdec.c: (gst_amrnbdec_class_init),
|
||||
(gst_amrnbdec_finalize):
|
||||
Don't leak the adapter, unref it in a new finalize method instead.
|
||||
Fixes #448782.
|
||||
|
||||
2007-06-19 Jan Schmidt <thaytan@mad.scientist.com>
|
||||
|
||||
* configure.ac:
|
||||
|
|
|
@ -53,6 +53,8 @@ static gboolean gst_amrnbdec_setcaps (GstPad * pad, GstCaps * caps);
|
|||
static GstStateChangeReturn gst_amrnbdec_state_change (GstElement * element,
|
||||
GstStateChange transition);
|
||||
|
||||
static void gst_amrnbdec_finalize (GObject * object);
|
||||
|
||||
#define _do_init(bla) \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_amrnbdec_debug, "amrnbdec", 0, "AMR-NB audio decoder");
|
||||
|
||||
|
@ -79,8 +81,11 @@ gst_amrnbdec_base_init (gpointer klass)
|
|||
static void
|
||||
gst_amrnbdec_class_init (GstAmrnbDecClass * klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
object_class->finalize = gst_amrnbdec_finalize;
|
||||
|
||||
element_class->change_state = GST_DEBUG_FUNCPTR (gst_amrnbdec_state_change);
|
||||
}
|
||||
|
||||
|
@ -109,6 +114,19 @@ gst_amrnbdec_init (GstAmrnbDec * amrnbdec, GstAmrnbDecClass * klass)
|
|||
amrnbdec->handle = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_amrnbdec_finalize (GObject * object)
|
||||
{
|
||||
GstAmrnbDec *amrnbdec;
|
||||
|
||||
amrnbdec = GST_AMRNBDEC (object);
|
||||
|
||||
gst_adapter_clear (amrnbdec->adapter);
|
||||
g_object_unref (amrnbdec->adapter);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_amrnbdec_setcaps (GstPad * pad, GstCaps * caps)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue