From 83d3b5d88e51311c2b1c2b43bdbacfc9472dc108 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Wed, 8 Oct 2008 08:54:55 +0000 Subject: [PATCH] gst/gstghostpad.c (gst_ghost_pad_construct): If we got a template via g_object_get(), be sure to unref it. Original commit message from CVS: 2008-10-08 Andy Wingo * gst/gstghostpad.c (gst_ghost_pad_construct): If we got a template via g_object_get(), be sure to unref it. * gst/gstbuffer.h (GST_BUFFER_FREE_FUNC): Fix incorrect doc. --- gst/gstbuffer.h | 4 ++-- gst/gstghostpad.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gst/gstbuffer.h b/gst/gstbuffer.h index e9e6287e1d..ca5d10c983 100644 --- a/gst/gstbuffer.h +++ b/gst/gstbuffer.h @@ -146,10 +146,10 @@ typedef struct _GstBufferClass GstBufferClass; * @buf: a #GstBuffer. * * A pointer to a function that will be called on the buffer's malloc_data when - * this buffer is finalized. Defaults to g_free() if NULL. + * this buffer is finalized. Defaults to g_free(). * * Note that the free function only affects the buffer's malloc_data; if the - * buffer's malloc_data is NULL, the function will not be called. + * buffer's malloc_data is %NULL, the function will not be called. * * Since: 0.10.22 */ diff --git a/gst/gstghostpad.c b/gst/gstghostpad.c index 7eb1ce0316..00452ef5f7 100644 --- a/gst/gstghostpad.c +++ b/gst/gstghostpad.c @@ -816,6 +816,8 @@ gst_ghost_pad_construct (GstGhostPad * gpad) internal = g_object_new (GST_TYPE_PROXY_PAD, "name", NULL, "direction", otherdir, "template", templ, NULL); + /* release ref obtained via g_object_get */ + gst_object_unref (templ); } else { internal = g_object_new (GST_TYPE_PROXY_PAD, "name", NULL,