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 738012 - Memleak when using Gst.Pipeline add() / remove()
Memleak when using Gst.Pipeline add() / remove()
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings: GTK+ GStreamer WebKitGTK+
0.26.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2014-10-06 15:36 UTC by arne
Modified: 2014-10-13 09:46 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description arne 2014-10-06 15:36:52 UTC
I discovered a memleak in my application, so I wrote this little test, which passes on 0.24.x and fails on 0.26.0:

public static int main(string[] argv)
{
  Gst.init(ref argv);
  var pipe = new Gst.Pipeline("pipe");
  var bin = Gst.ElementFactory.make("fakesink", "somename");

  assert(bin.ref_count == 1);
  pipe.add(bin);
  pipe.remove(bin);
  assert(bin.ref_count == 1);

  stdout.printf("gstreamer: OK\n");
  return 0;
}

$ valac gstreamer.vala -g --pkg=gstreamer-1.0 --enable-experimental && ./gstreamer 
**
ERROR:/home/thedoc/projects/vms/test/gstreamer.vala:10:_vala_main: assertion failed: (bin.ref_count == 1)


$ pkg-config --modversion gstreamer-1.0 
1.4.3

$ valac --version
Vala 0.26.0



In the git-repo I found a series of commits to 0.24.x regarding this issue, but they got reverted in the current release:
https://git.gnome.org/browse/vala/commit/?h=0.24&id=8fd03272c3dea767f757f73d2ff2c8dde70c0331
https://git.gnome.org/browse/vala/commit/?h=0.24&id=8e25c2b52e4cfe286a988d9f86f5e5a86b7736cf
https://git.gnome.org/browse/vala/commit/?h=0.24&id=47868c96854fbdd146493b16ac8ab87f0f9cc8bd
Comment 1 Luca Bruno 2014-10-13 09:46:13 UTC
commit afb3846cb9b89bc154d9d774dc500fb2bce55d7a
Author: Luca Bruno <luca.bruno@immobiliare.it>
Date:   Mon Oct 13 11:41:37 2014 +0200

    gstreamer-1.0: remove owned to floating reference parameters
    
    Commit 6296d34707 (bug 730983) added the owned
    keyword back without any reason.
    
    Fixes bug 738012

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.
Comment 2 Luca Bruno 2014-10-13 09:46:56 UTC
Cherry-picked as d4d378c in 0.26.