GNOME Bugzilla – Bug 321543
GstPadTemplate leaks
Last modified: 2006-03-07 10:05:21 UTC
According to valgrind we're leaking quite a few GstPadTemplates. I've fixed a few of them, which I'll submit patches for here. Can anything be done in the general case, to make it easier to not leak?
Created attachment 54793 [details] [review] gstbasesrc
Created attachment 54794 [details] [review] gst-plugins-base: oggdemux/vorbisdec fixes
Something weird here - none of those pad_templates are supposed to need unreffing. Can you still reproduce the problem in valgrind?
I don't have a tree so I cannot check right now. It might be/have been a mismatch between GObject and GstObject. Did any fixes related to templates go in since I reported this bug?
Actually, I'm wrong - the basesrc patch no longer seems relevant, gst_pad_new_from_static_template', which does correct unreffing. The remaining fix is a leaked refcount in vorbisdec adding pad_templates to the class in base_init, but almost everywhere has that leak. We never unload classes though, so noone ever notices and I'm not sure we should bother fixing it until a hypothetical future where we've reworked every plugin to support it.
Hrmn, something got lost in translation there. I was trying to say that there are leaks when adding the pad template to the class, and leaks adding pads from the pad template. The 2nd case seems to have been fixed in vorbisdec and oggdemux by using gst_pad_new_from_static_template, and I'm not sure we need to fix the first one since we never unload classes anyway.