summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sf.net>2009-04-07 22:38:29 +0300
committerStefan Kost <ensonic@users.sf.net>2009-04-07 22:39:07 +0300
commitff9ee1dc5ac0c18e0f886663a7bcd5dd063f3f25 (patch)
tree8fe984b0b121c22f3fe24f14287ac08e029ae7a4
parent164f1dbd1c9d5aea00f6df1ca90fe81c3f57b9f1 (diff)
audiofilter: don't leak pad-template
gst_element_class_add_pad_template() does not take ownership.
-rw-r--r--gst-libs/gst/audio/gstaudiofilter.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/gst-libs/gst/audio/gstaudiofilter.c b/gst-libs/gst/audio/gstaudiofilter.c
index 9c329bfb0..7d21e1487 100644
--- a/gst-libs/gst/audio/gstaudiofilter.c
+++ b/gst-libs/gst/audio/gstaudiofilter.c
@@ -220,16 +220,19 @@ gst_audio_filter_class_add_pad_templates (GstAudioFilterClass * klass,
const GstCaps * allowed_caps)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
+ GstPadTemplate *pad_template;
g_return_if_fail (GST_IS_AUDIO_FILTER_CLASS (klass));
g_return_if_fail (allowed_caps != NULL);
g_return_if_fail (GST_IS_CAPS (allowed_caps));
- gst_element_class_add_pad_template (element_class,
- gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
- gst_caps_copy (allowed_caps)));
+ pad_template = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
+ gst_caps_copy (allowed_caps));
+ gst_element_class_add_pad_template (element_class, pad_template);
+ gst_object_unref (pad_template);
- gst_element_class_add_pad_template (element_class,
- gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
- gst_caps_copy (allowed_caps)));
+ pad_template = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
+ gst_caps_copy (allowed_caps));
+ gst_element_class_add_pad_template (element_class, pad_template);
+ gst_object_unref (pad_template);
}