GNOME Bugzilla – Bug 340608
leaking caps in padtemplate
Last modified: 2006-05-07 19:58:14 UTC
gst_static_pad_template_get() seems to leak the caps from the gst_static_caps_get() call. Out of curiosity wouldn't gst_caps_make_writable() be better that gst_caps_copy() and gst_caps_unref() ? attached patch changes it to: caps = gst_static_caps_get (&pad_template->static_caps); GST_PAD_TEMPLATE_CAPS (new) = gst_caps_copy (caps); gst_caps_unref (caps); would this also work? GST_PAD_TEMPLATE_CAPS (new) = gst_caps_make_writable ( gst_static_caps_get (&pad_template->static_caps));
Created attachment 64799 [details] [review] unref the caps
Both should work (I think the version in your patch is nicer to read though). The static caps are leaked in any case though, aren't they? (the question is just what refcount they're gonna have at the end of the day, isn't it?)
the docs to gst_static_caps_get() suggest to use gst_caps_make_writable(), so I switch to this. 2006-05-07 Stefan Kost <ensonic@users.sf.net> * gst/gstpadtemplate.c: (gst_static_pad_template_get): use gst_caps_make_writable instead of gst_caps_copy, Fixes #340608