GNOME Bugzilla – Bug 702969
Vala unnecesarily refs first element passed to Gst.Bin.add_many()
Last modified: 2014-03-16 15:23:29 UTC
Created attachment 247630 [details] Test case (Vala) First Gst.Element passed to Gst.Bin.add_many() is reffed by vala in the C code, in opossition to any other arguments passed to this function. This is obviously incosistent behaviour. None of passed elements should be reffed. Current approach leads to memory leaks. Vala 0.20.1
Created attachment 247631 [details] Test case (C)
Same problem as bug 702943
As a first step, I expect that Gst.ElementFactory.make should return a floating reference, i.e., drop 'unowned' and add 'returns_floating_reference' attribute - as is the case in the GStreamer 0.10 binding.
Who should mark this as floating? Vala developers or Gst developers?
(In reply to comment #4) > Who should mark this as floating? Vala developers or Gst developers? Gst developers should fix a couple of annotations, or at least I'd like to hear from them if there's a reason why those functions are not marked to return a floating reference.
Luca, Gst developers replied with some proposal in bug #702960, can you join the discussion there, please? I am unable to help on my own as I don't know how Vala bindings are generated.
commit 8e25c2b52e4cfe286a988d9f86f5e5a86b7736cf Author: Luca Bruno <lucabru@src.gnome.org> Date: Sun Mar 16 16:21:27 2014 +0100 gstreamer-1.0: Make Bin.add_many first parameter unowned Fixes bug 702969 ElementFactory.make returns a floating reerence nowadays, I've also fixed bug #702960 for what concerns vala. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.