creation_call.add_argument (new CCodeIdentifier ("sizeof (%s)".printf (get_ccode_name (expr.inner.value_type))));
ccode.add_expression (creation_call);
} else if (expr.value_type is DelegateType) {
+ ccode.add_assignment (get_cvalue (expr.inner), new CCodeConstant ("NULL"));
+ var target = get_delegate_target_cvalue (expr.inner.target_value);
+ if (target != null) {
+ ccode.add_assignment (target, new CCodeConstant ("NULL"));
+ }
var target_destroy_notify = get_delegate_target_destroy_notify_cvalue (expr.inner.target_value);
if (target_destroy_notify != null) {
ccode.add_assignment (target_destroy_notify, new CCodeConstant ("NULL"));
structs/bug775761.vala \
structs/bug777194.vala \
delegates/delegates.vala \
+ delegates/reference_transfer.vala \
delegates/bug539166.vala \
delegates/bug595610.vala \
delegates/bug595639.vala \
--- /dev/null
+delegate void FooFunc ();
+
+class Foo {
+ FooFunc f;
+
+ public Foo (owned FooFunc d) {
+ f = (owned) d;
+ assert (d == null);
+ }
+}
+
+void main () {
+ var foo = new Foo (() => {});
+}