From 63d629aba560512a97e36699be16f840f7603b97 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 17 Aug 2013 00:23:08 +0100 Subject: [PATCH] aiffparse: don't leak adapter --- gst/aiff/aiffparse.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gst/aiff/aiffparse.c b/gst/aiff/aiffparse.c index 183e0b9e10..eaa1b819e9 100644 --- a/gst/aiff/aiffparse.c +++ b/gst/aiff/aiffparse.c @@ -1645,13 +1645,17 @@ gst_aiff_parse_sink_activate_mode (GstPad * sinkpad, GstObject * parent, gboolean res; GstAiffParse *aiff = GST_AIFF_PARSE (parent); - if (aiff->adapter) + if (aiff->adapter) { g_object_unref (aiff->adapter); + aiff->adapter = NULL; + } switch (mode) { case GST_PAD_MODE_PUSH: - aiff->streaming = TRUE; - aiff->adapter = gst_adapter_new (); + if (active) { + aiff->streaming = TRUE; + aiff->adapter = gst_adapter_new (); + } res = TRUE; break; case GST_PAD_MODE_PULL: -- 2.34.1