From: David Schleef Date: Sun, 13 Jul 2003 19:15:30 +0000 (+0000) Subject: add warning if getcaps function returns an unreferenced caps X-Git-Tag: BRANCH-ERROR-ROOT~112 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=88282d4f0520579285335c9c55b54192916489a9;p=platform%2Fupstream%2Fgstreamer.git add warning if getcaps function returns an unreferenced caps Original commit message from CVS: add warning if getcaps function returns an unreferenced caps --- diff --git a/gst/gstpad.c b/gst/gstpad.c index bcd60f5..45d3694 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -1833,8 +1833,13 @@ gst_pad_get_caps (GstPad *pad) return GST_PAD_CAPS (realpad); } else if GST_RPAD_GETCAPSFUNC (realpad) { + GstCaps *caps; + GST_CAT_DEBUG (GST_CAT_CAPS, "using pad get function"); - return GST_RPAD_GETCAPSFUNC (realpad) (GST_PAD_CAST (realpad), NULL); + caps = GST_RPAD_GETCAPSFUNC (realpad) (GST_PAD_CAST (realpad), NULL); + if(caps)g_return_val_if_fail(caps->refcount > 0, NULL); + + return caps; } else if (GST_PAD_PAD_TEMPLATE (realpad)) { GstPadTemplate *templ = GST_PAD_PAD_TEMPLATE (realpad);