GNOME Bugzilla – Bug 780426
Casting delegates to owned parameters/variables leaks target-reference
Last modified: 2017-06-22 14:48:54 UTC
delegate void FooFunc (); class Foo : Object { public Foo () { bar ((FooFunc) func); } public void func () { } void bar (owned FooFunc f) { } } void main () { var foo = new Foo (); FooFunc f = foo.func; } bar ((FooFunc) func); >>> foo_bar (self, (FooFunc) foo_func, g_object_ref (self), NULL); FooFunc f = foo.func; >>> f = (FooFunc) foo_func; f_target = g_object_ref (foo); f_target_destroy_notify = NULL; This is a regression of commit 6d07669384cdb70c3c657dba67d5048212f25da9 Author: Luca Bruno <lucabru@src.gnome.org> Date: Thu Jul 11 22:39:53 2013 +0200 codegen: Allow scope=async delegates to be used in vala code Fixes bug 703804
Created attachment 348544 [details] [review] codegen: Don't leak target-reference when casting/assigning owned delegates Regression of 6d07669384cdb70c3c657dba67d5048212f25da9
commit 74aa6d2ab5d8c0a787ac8d9003c50233d5765a6e Author: Rico Tzschichholz <ricotz@ubuntu.com> Date: Wed Mar 22 19:16:06 2017 +0100 codegen: Don't leak target-reference when casting/assigning owned delegates Regression of 6d07669384cdb70c3c657dba67d5048212f25da9