After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 702969 - Vala unnecesarily refs first element passed to Gst.Bin.add_many()
Vala unnecesarily refs first element passed to Gst.Bin.add_many()
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings: GTK+ GStreamer WebKitGTK+
0.20.x
Other Linux
: Normal major
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on: 702960
Blocks:
 
 
Reported: 2013-06-24 12:51 UTC by Marcin Lewandowski
Modified: 2014-03-16 15:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case (Vala) (364 bytes, text/x-vala)
2013-06-24 12:51 UTC, Marcin Lewandowski
Details
Test case (C) (3.67 KB, text/x-csrc)
2013-06-24 12:52 UTC, Marcin Lewandowski
Details

Description Marcin Lewandowski 2013-06-24 12:51:49 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
Comment 1 Marcin Lewandowski 2013-06-24 12:52:04 UTC
Created attachment 247631 [details]
Test case (C)
Comment 2 Luca Bruno 2013-06-24 12:55:55 UTC
Same problem as bug 702943
Comment 3 Jürg Billeter 2013-06-24 14:14:08 UTC
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.
Comment 4 Marcin Lewandowski 2013-06-30 15:41:08 UTC
Who should mark this as floating? Vala developers or Gst developers?
Comment 5 Luca Bruno 2013-07-01 07:18:30 UTC
(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.
Comment 6 Marcin Lewandowski 2013-07-01 12:05:55 UTC
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.
Comment 7 Luca Bruno 2014-03-16 15:23:29 UTC
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.