GNOME Bugzilla – Bug 347311
element_unlink leaks its iterator wich will leak the src element ref
Last modified: 2006-07-14 18:00:20 UTC
In the element_unlink function the iterator is not freed and since it's a gst_element_iterator , the element is reffed by the iterator so if the iterator is not freed we leak a ref of the element... wich is kinda bad in _unlink since all the elements can have a ref leaked
Created attachment 68819 [details] [review] Patch to free the iterator
Created attachment 68915 [details] [review] patch with unit test showing the leak against tests/check/gst/gstutils.c
Actually, as discussed on IRC, I think it's better if we hold off on this until after the release. As pointed out by thomasvs we've traditionally been bitten about 50% of the time by including unref patches without thorough testing, because of apps that have somehow been relying on the behaviour. It will be better to know if it breaks anything and provide the app authors some warning.
Thanks for the patch, committed to CVS: 2006-07-14 Tim-Philipp Müller <tim at centricular dot net> Patch by: Antoine Tremblay <hexa00 at gmail com> * gst/gstutils.c: (gst_element_unlink): Free iterator when done (#347311). * tests/check/gst/gstutils.c: (GST_START_TEST), (gst_utils_suite): And add a test case for this.