}
} else if ((prop.property_type is DelegateType) && get_ccode_delegate_target (prop) && ((DelegateType) prop.property_type).delegate_symbol.has_target) {
vdeclarator.add_parameter (new CCodeParameter (get_delegate_target_cname ("value"), "gpointer"));
+ if (prop.set_accessor.value_type.value_owned) {
+ vdeclarator.add_parameter (new CCodeParameter (get_delegate_target_destroy_notify_cname ("value"), get_ccode_name (delegate_target_destroy_type)));
+ }
}
var vdecl = new CCodeDeclaration ("void");
objects/property-construct-only-write.test \
objects/property-construct-only-write-foreign.test \
objects/property-delegate.vala \
+ objects/property-delegate-owned.vala \
objects/property-gboxed-nullable.vala \
objects/property-real-struct-no-accessor.test \
objects/property-simple-type-struct-nullable.vala \
--- /dev/null
+delegate void FooFunc ();
+
+interface IFoo {
+ public abstract FooFunc foo { get; owned set; }
+ public abstract FooFunc bar { get; owned set; }
+}
+
+class Foo : IFoo {
+ FooFunc? _bar;
+
+ public virtual FooFunc foo { get; owned set; }
+
+ public virtual FooFunc bar {
+ get {
+ return _bar;
+ }
+ owned set {
+ _bar = (owned) value;
+ }
+ }
+
+ public Foo () {
+ foo = () => {};
+ bar = () => {};
+ }
+}
+
+class Bar : Foo {
+ FooFunc? _bar;
+
+ public override FooFunc foo { get; owned set; }
+
+ public override FooFunc bar {
+ get {
+ return _bar;
+ }
+ owned set {
+ _bar = (owned) value;
+ }
+ }
+
+ public Bar () {
+ foo = () => {};
+ bar = () => {};
+ }
+}
+
+void main () {
+ var foo = new Foo ();
+ foo.foo ();
+ var bar = new Bar ();
+ bar.bar ();
+}