int indent;
private TypeSymbol gobject_type;
+ private TypeSymbol ginitiallyunowned_type;
private struct GIRNamespace {
public GIRNamespace (string ns, string version) {
var root_symbol = context.root;
var glib_ns = root_symbol.scope.lookup ("GLib");
gobject_type = (TypeSymbol) glib_ns.scope.lookup ("Object");
+ ginitiallyunowned_type = (TypeSymbol) glib_ns.scope.lookup ("InitiallyUnowned");
write_package (package);
DelegateType delegate_type = type as DelegateType;
- if ((type.value_owned && delegate_type == null) || constructor) {
+ if ((type.value_owned && delegate_type == null) || (constructor && !type.data_type.is_subtype_of (ginitiallyunowned_type))) {
buffer.append_printf (" transfer-ownership=\"full\"");
} else {
buffer.append_printf (" transfer-ownership=\"none\"");