Index: gio/gio.defs
===================================================================
--- gio/gio.defs	(revision 998)
+++ gio/gio.defs	(working copy)
@@ -28,6 +28,7 @@
   (of-object "GAppInfo")
   (c-name "g_app_info_dup")
   (return-type "GAppInfo*")
+  (caller-owns-return #t)
 )
 
 (define-method equal
@@ -556,6 +557,7 @@
 (define-function content_type_get_icon
   (c-name "g_content_type_get_icon")
   (return-type "GIcon*")
+  (caller-owns-return #t)
   (parameters
     '("const-char*" "type")
   )
@@ -886,6 +888,7 @@
   (of-object "GDrive")
   (c-name "g_drive_get_icon")
   (return-type "GIcon*")
+  (caller-owns-return #t)
 )
 
 (define-method has_volumes
@@ -1049,6 +1052,7 @@
   (of-object "GFileEnumerator")
   (c-name "g_file_enumerator_next_file")
   (return-type "GFileInfo*")
+  (caller-owns-return #t)
   (parameters
     '("GCancellable*" "cancellable" (null-ok) (default "NULL"))
     '("GError**" "error")
@@ -1194,6 +1198,7 @@
 (define-function file_parse_name
   (c-name "g_file_parse_name")
   (return-type "GFile*")
+  (caller-owns-return #t)
   (parameters
     '("const-char*" "parse_name")
   )
@@ -1203,6 +1208,7 @@
   (of-object "GFile")
   (c-name "g_file_dup")
   (return-type "GFile*")
+  (caller-owns-return #t)
 )
 
 (define-function file_hash
@@ -1250,12 +1256,14 @@
   (of-object "GFile")
   (c-name "g_file_get_parent")
   (return-type "GFile*")
+  (caller-owns-return #t)
 )
 
 (define-method get_child
   (of-object "GFile")
   (c-name "g_file_get_child")
   (return-type "GFile*")
+  (caller-owns-return #t)
   (parameters
     '("const-char*" "name")
   )
@@ -1265,6 +1273,7 @@
   (of-object "GFile")
   (c-name "g_file_get_child_for_display_name")
   (return-type "GFile*")
+  (caller-owns-return #t)
   (parameters
     '("const-char*" "display_name")
     '("GError**" "error")
@@ -1293,6 +1302,7 @@
   (of-object "GFile")
   (c-name "g_file_resolve_relative_path")
   (return-type "GFile*")
+  (caller-owns-return #t)
   (parameters
     '("const-char*" "relative_path")
   )
@@ -1336,6 +1346,7 @@
   )
   (c-name "g_file_read")
   (return-type "GFileInputStream*")
+  (caller-owns-return #t)
   (parameters
     '("GCancellable*" "cancellable" (null-ok) (default "NULL"))
     '("GError**" "error")
@@ -1368,6 +1379,7 @@
   (of-object "GFile")
   (c-name "g_file_read_finish")
   (return-type "GFileInputStream*")
+  (caller-owns-return #t)
   (parameters
     '("GAsyncResult*" "res")
     '("GError**" "error")
@@ -1378,6 +1390,7 @@
   (of-object "GFile")
   (c-name "g_file_append_to")
   (return-type "GFileOutputStream*")
+  (caller-owns-return #t)
   (parameters
     '("GFileCreateFlags" "flags" (default "G_FILE_CREATE_NONE"))
     '("GCancellable*" "cancellable" (null-ok) (default "NULL"))
@@ -1389,6 +1402,7 @@
   (of-object "GFile")
   (c-name "g_file_create")
   (return-type "GFileOutputStream*")
+  (caller-owns-return #t)
   (parameters
     '("GFileCreateFlags" "flags" (default "G_FILE_CREATE_NONE"))
     '("GCancellable*" "cancellable" (null-ok) (default "NULL"))
@@ -1400,6 +1414,7 @@
   (of-object "GFile")
   (c-name "g_file_replace")
   (return-type "GFileOutputStream*")
+  (caller-owns-return #t)
   (parameters
     '("const-char*" "etag")
     '("gboolean" "make_backup")
@@ -1436,6 +1451,7 @@
   (of-object "GFile")
   (c-name "g_file_append_to_finish")
   (return-type "GFileOutputStream*")
+  (caller-owns-return #t)
   (parameters
     '("GAsyncResult*" "res")
     '("GError**" "error")
@@ -1470,6 +1486,7 @@
   (of-object "GFile")
   (c-name "g_file_create_finish")
   (return-type "GFileOutputStream*")
+  (caller-owns-return #t)
   (parameters
     '("GAsyncResult*" "res")
     '("GError**" "error")
@@ -1506,6 +1523,7 @@
   (of-object "GFile")
   (c-name "g_file_replace_finish")
   (return-type "GFileOutputStream*")
+  (caller-owns-return #t)
   (parameters
     '("GAsyncResult*" "res")
     '("GError**" "error")
@@ -1525,6 +1543,7 @@
   (of-object "GFile")
   (c-name "g_file_query_info")
   (return-type "GFileInfo*")
+  (caller-owns-return #t)
   (parameters
     '("const-char*" "attributes")
     '("GFileQueryInfoFlags" "flags" (default "G_FILE_QUERY_INFO_NONE"))
@@ -1563,6 +1582,7 @@
   (of-object "GFile")
   (c-name "g_file_query_info_finish")
   (return-type "GFileInfo*")
+  (caller-owns-return #t)
   (parameters
     '("GAsyncResult*" "res")
     '("GError**" "error")
@@ -1573,6 +1593,7 @@
   (of-object "GFile")
   (c-name "g_file_query_filesystem_info")
   (return-type "GFileInfo*")
+  (caller-owns-return #t)
   (parameters
     '("const-char*" "attributes")
     '("GCancellable*" "cancellable" (null-ok) (default "NULL"))
@@ -1584,6 +1605,7 @@
   (of-object "GFile")
   (c-name "g_file_find_enclosing_mount")
   (return-type "GMount*")
+  (caller-owns-return #t)
   (parameters
     '("GCancellable*" "cancellable" (null-ok) (default "NULL"))
     '("GError**" "error")
@@ -1606,6 +1628,7 @@
   (of-object "GFile")
   (c-name "g_file_find_enclosing_mount_finish")
   (return-type "GMount*")
+  (caller-owns-return #t)
   (parameters
     '("GAsyncResult*" "res")
     '("GError**" "error")
@@ -1637,6 +1660,7 @@
   (of-object "GFile")
   (c-name "g_file_enumerate_children")
   (return-type "GFileEnumerator*")
+  (caller-owns-return #t)
   (parameters
     '("const-char*" "attributes")
     '("GFileQueryInfoFlags" "flags" (default "G_FILE_QUERY_INFO_NONE"))
@@ -1675,6 +1699,7 @@
   (of-object "GFile")
   (c-name "g_file_enumerate_children_finish")
   (return-type "GFileEnumerator*")
+  (caller-owns-return #t)
   (parameters
     '("GAsyncResult*" "res")
     '("GError**" "error")
@@ -1685,6 +1710,7 @@
   (of-object "GFile")
   (c-name "g_file_set_display_name")
   (return-type "GFile*")
+  (caller-owns-return #t)
   (parameters
     '("const-char*" "display_name")
     '("GCancellable*" "cancellable" (null-ok) (default "NULL"))
@@ -1709,6 +1735,7 @@
   (of-object "GFile")
   (c-name "g_file_set_display_name_finish")
   (return-type "GFile*")
+  (caller-owns-return #t)
   (parameters
     '("GAsyncResult*" "res")
     '("GError**" "error")
@@ -2143,6 +2170,7 @@
   (of-object "GFile")
   (c-name "g_file_mount_mountable_finish")
   (return-type "GFile*")
+  (caller-owns-return #t)
   (parameters
     '("GAsyncResult*" "result")
     '("GError**" "error")
@@ -2220,6 +2248,7 @@
   (of-object "GFile")
   (c-name "g_file_monitor_directory")
   (return-type "GFileMonitor*")
+  (caller-owns-return #t)
   (parameters
     '("GFileMonitorFlags" "flags" (default "G_FILE_MONITOR_NONE"))
     '("GCancellable*" "cancellable" (null-ok) (default "NULL"))
@@ -2231,6 +2260,7 @@
   (of-object "GFile")
   (c-name "g_file_monitor_file")
   (return-type "GFileMonitor*")
+  (caller-owns-return #t)
   (parameters
     '("GFileMonitorFlags" "flags" (default "G_FILE_MONITOR_NONE"))
     '("GCancellable*" "cancellable" (null-ok) (default "NULL"))
@@ -2242,6 +2272,7 @@
   (of-object "GFile")
   (c-name "g_file_query_default_handler")
   (return-type "GAppInfo*")
+  (caller-owns-return #t)
   (parameters
     '("GCancellable*" "cancellable" (null-ok) (default "NULL"))
     '("GError**" "error")
@@ -2458,6 +2489,7 @@
   (of-object "GFileInfo")
   (c-name "g_file_info_dup")
   (return-type "GFileInfo*")
+  (caller-owns-return #t)
 )
 
 (define-method copy_into
@@ -3781,6 +3813,7 @@
   (of-object "GMount")
   (c-name "g_mount_get_root")
   (return-type "GFile*")
+  (caller-owns-return #t)
 )
 
 (define-method get_name
@@ -3793,6 +3826,7 @@
   (of-object "GMount")
   (c-name "g_mount_get_icon")
   (return-type "GIcon*")
+  (caller-owns-return #t)
 )
 
 (define-method get_uuid
@@ -3805,12 +3839,14 @@
   (of-object "GMount")
   (c-name "g_mount_get_volume")
   (return-type "GVolume*")
+  (caller-owns-return #t)
 )
 
 (define-method get_drive
   (of-object "GMount")
   (c-name "g_mount_get_drive")
   (return-type "GDrive*")
+  (caller-owns-return #t)
 )
 
 (define-method can_unmount
@@ -4600,6 +4636,7 @@
   (of-object "GVfs")
   (c-name "g_vfs_get_file_for_path")
   (return-type "GFile*")
+  (caller-owns-return #t)
   (parameters
     '("const-char*" "path")
   )
@@ -4609,6 +4646,7 @@
   (of-object "GVfs")
   (c-name "g_vfs_get_file_for_uri")
   (return-type "GFile*")
+  (caller-owns-return #t)
   (parameters
     '("const-char*" "uri")
   )
@@ -4618,6 +4656,7 @@
   (of-object "GVfs")
   (c-name "g_vfs_parse_name")
   (return-type "GFile*")
+  (caller-owns-return #t)
   (parameters
     '("const-char*" "parse_name")
   )
@@ -4670,6 +4709,7 @@
   (of-object "GVolume")
   (c-name "g_volume_get_icon")
   (return-type "GIcon*")
+  (caller-owns-return #t)
 )
 
 (define-method get_uuid
@@ -4682,12 +4722,14 @@
   (of-object "GVolume")
   (c-name "g_volume_get_drive")
   (return-type "GDrive*")
+  (caller-owns-return #t)
 )
 
 (define-method get_mount
   (of-object "GVolume")
   (c-name "g_volume_get_mount")
   (return-type "GMount*")
+  (caller-owns-return #t)
 )
 
 (define-method can_mount
@@ -4794,6 +4836,7 @@
   (of-object "GVolumeMonitor")
   (c-name "g_volume_monitor_get_volume_for_uuid")
   (return-type "GVolume*")
+  (caller-owns-return #t)
   (parameters
     '("const-char*" "uuid")
   )
@@ -4803,6 +4846,7 @@
   (of-object "GVolumeMonitor")
   (c-name "g_volume_monitor_get_mount_for_uuid")
   (return-type "GMount*")
+  (caller-owns-return #t)
   (parameters
     '("const-char*" "uuid")
   )
Index: gio/gfile.override
===================================================================
--- gio/gfile.override	(revision 998)
+++ gio/gfile.override	(working copy)
@@ -75,6 +75,7 @@
     GFile *file;
     Py_ssize_t n_args, n_kwargs;
     char *arg;
+    PyObject *py_ret;
 
     n_args = PyTuple_Size(args);
     n_kwargs = kwargs != NULL ? PyDict_Size(kwargs) : 0;
@@ -114,7 +115,11 @@
 			"could not create GFile object");
         return NULL;
     }
-    return pygobject_new((GObject *)file);
+
+    py_ret = pygobject_new((GObject *)file);
+    g_object_unref(file);
+
+    return py_ret;
 }
 %%
 override g_file_read_async kwargs
