GNOME Bugzilla – Bug 738012
Memleak when using Gst.Pipeline add() / remove()
Last modified: 2014-10-13 09:46:56 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
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.
Cherry-picked as d4d378c in 0.26.