ccode.add_declaration (return_type_cname, new CCodeVariableDeclarator ("result", ccall));
}
- if (d.has_target && !dt.value_owned && dt.is_called_once) {
+ if (d.has_target /* TODO: && dt.value_owned */ && dt.is_called_once) {
// destroy notify "self" after the call
CCodeExpression? destroy_notify = null;
if (m.closure) {
cexpr = new CCodeConditionalExpression (new CCodeBinaryExpression (CCodeBinaryOperator.EQUALITY, cexpr, new CCodeIdentifier ("NULL")), new CCodeIdentifier ("NULL"), closure_new);
} else {
carg_map.set (get_param_pos (get_ccode_delegate_target_pos (param)), delegate_target);
- if (deleg_type.value_owned) {
+ if (deleg_type.value_owned && !deleg_type.is_called_once) {
assert (delegate_target_destroy_notify != null);
carg_map.set (get_param_pos (get_ccode_delegate_target_pos (param) + 0.01), delegate_target_destroy_notify);
}
var callback_type = new DelegateType ((Delegate) glib_ns.scope.lookup ("AsyncReadyCallback"));
callback_type.nullable = true;
+ callback_type.value_owned = true;
callback_type.is_called_once = true;
var callback_param = new Parameter ("_callback_", callback_type);