}
} else if ((acc.value_type is DelegateType) && ((DelegateType) acc.value_type).delegate_symbol.has_target) {
function.add_parameter (new CCodeParameter (get_delegate_target_cname (acc.readable ? "result" : "value"), acc.readable ? "gpointer*" : "gpointer"));
+ if (!acc.readable && acc.value_type.value_owned) {
+ function.add_parameter (new CCodeParameter (get_delegate_target_destroy_notify_cname ("value"), "GDestroyNotify"));
+ }
}
if (prop.is_private_symbol () || (!acc.readable && !acc.writable) || acc.access == SymbolAccessibility.PRIVATE) {
}
} else if ((acc.value_type is DelegateType) && ((DelegateType) acc.value_type).delegate_symbol.has_target) {
function.add_parameter (new CCodeParameter (get_delegate_target_cname (acc.readable ? "result" : "value"), acc.readable ? "gpointer*" : "gpointer"));
+ if (!acc.readable && acc.value_type.value_owned) {
+ function.add_parameter (new CCodeParameter (get_delegate_target_destroy_notify_cname ("value"), "GDestroyNotify"));
+ }
}
if (prop.is_private_symbol () || !(acc.readable || acc.writable) || acc.access == SymbolAccessibility.PRIVATE) {
}
} else if ((acc.value_type is DelegateType) && ((DelegateType) acc.value_type).delegate_symbol.has_target) {
vcall.add_argument (new CCodeIdentifier (get_delegate_target_cname ("value")));
+ if (!acc.readable && acc.value_type.value_owned) {
+ vcall.add_argument (new CCodeIdentifier (get_delegate_target_destroy_notify_cname ("value")));
+ }
}
ccode.add_expression (vcall);
}
} else if ((acc.value_type is DelegateType) && ((DelegateType) acc.value_type).delegate_symbol.has_target) {
function.add_parameter (new CCodeParameter (get_delegate_target_cname (acc.readable ? "result" : "value"), acc.readable ? "gpointer*" : "gpointer"));
+ if (!acc.readable && acc.value_type.value_owned) {
+ function.add_parameter (new CCodeParameter (get_delegate_target_destroy_notify_cname ("value"), "GDestroyNotify"));
+ }
}
if (!is_virtual) {
var delegate_type = (DelegateType) prop.property_type;
if (delegate_type.delegate_symbol.has_target) {
ccall.add_argument (get_delegate_target_cvalue (value));
+ if (delegate_type.value_owned) {
+ ccall.add_argument (get_delegate_target_destroy_notify_cvalue (value));
+ }
}
}
using GLib;
+public delegate void Delegate ();
+
public class Sample : Object {
private string automatic { get; set; }
+ public Delegate deleg { get; owned set; }
+
private string _name;
public string name {
get { return _name; }
stdout.printf("name: %s\n", name);
stdout.printf("read_only: %s\n", read_only);
stdout.printf("automatic: %s\n", automatic);
+
+ this.deleg = null;
}
public static int main () {