From 112c6867f305b07bfe5c2a95a82c60426d88754f Mon Sep 17 00:00:00 2001 From: David Schleef Date: Thu, 24 Jul 2003 07:03:56 +0000 Subject: [PATCH] Properly ref caps and pad template in FACTORY macros Original commit message from CVS: Properly ref caps and pad template in FACTORY macros --- gst/gstcaps.h | 4 ++-- gst/gstpad.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gst/gstcaps.h b/gst/gstcaps.h index 81019a0..88297b5 100644 --- a/gst/gstcaps.h +++ b/gst/gstcaps.h @@ -90,7 +90,7 @@ factoryname (void) \ if (!caps) { \ caps = gst_caps_chain (__VA_ARGS__, NULL); \ } \ - return caps; \ + return gst_caps_ref(caps); \ } #elif defined(G_HAVE_GNUC_VARARGS) #define GST_CAPS_NEW(name, type, a...) \ @@ -109,7 +109,7 @@ factoryname (void) \ if (!caps) { \ caps = gst_caps_chain (a, NULL); \ } \ - return caps; \ + return gst_caps_ref(caps); \ } #endif diff --git a/gst/gstpad.h b/gst/gstpad.h index 860393f..0280e50 100644 --- a/gst/gstpad.h +++ b/gst/gstpad.h @@ -348,7 +348,7 @@ name (void) \ pres, \ __VA_ARGS__ ); \ } \ - return templ; \ + return (GstPadTemplate *)g_object_ref((GObject *)templ); \ } #elif defined(G_HAVE_GNUC_VARARGS) /* CR1: the space after 'a' is necessary because of preprocessing in gcc */ @@ -372,7 +372,7 @@ name (void) \ pres, \ a ); \ } \ - return templ; \ + return (GstPadTemplate *)g_object_ref((GObject *)templ); \ } #endif -- 2.7.4