pygobject r951 - in trunk: . gio



Author: paulp
Date: Wed Aug 27 21:28:15 2008
New Revision: 951
URL: http://svn.gnome.org/viewvc/pygobject?rev=951&view=rev

Log:
2008-08-28  Paul Pogonyshev  <pogonyshev gmx net>

	Bug 547088 â wrap g_content_types_get_registered()

	* gio/gio.override (_wrap_g_drive_get_volumes): Fix refleak.
	(_wrap_g_content_types_get_registered): New function.

	* gio/gfileenumerator.override (_wrap_g_file_enumerator_next_files_finish):
	Fix refleak.

	* gio/gvolumemonitor.override (_wrap_g_volume_monitor_get_connected_drives):
	Fix refleak.
	(_wrap_g_volume_monitor_get_volumes): Likewise.
	(_wrap_g_volume_monitor_get_mounts): Likewise.


Modified:
   trunk/ChangeLog
   trunk/gio/gfileenumerator.override
   trunk/gio/gio.override
   trunk/gio/gvolumemonitor.override

Modified: trunk/gio/gfileenumerator.override
==============================================================================
--- trunk/gio/gfileenumerator.override	(original)
+++ trunk/gio/gfileenumerator.override	Wed Aug 27 21:28:15 2008
@@ -133,6 +133,7 @@
 	PyObject *item = pygobject_new((GObject *)file_info);
 	PyList_Append(ret, item);
 	Py_DECREF(item);
+	g_object_unref(file_info);
     }
     g_list_free(next_files);
 

Modified: trunk/gio/gio.override
==============================================================================
--- trunk/gio/gio.override	(original)
+++ trunk/gio/gio.override	Wed Aug 27 21:28:15 2008
@@ -133,6 +133,7 @@
     PyObject *item = pygobject_new((GObject *)volume);
     PyList_Append(ret, item);
     Py_DECREF(item);
+    g_object_unref(volume);
   }
   g_list_free(list);
 
@@ -512,3 +513,25 @@
 
     return ret;
 }
+%%
+override g_content_types_get_registered noargs
+static PyObject *
+_wrap_g_content_types_get_registered(PyObject *self)
+{
+    GList *list, *l;
+    PyObject *ret;
+
+    list = g_content_types_get_registered();
+
+    ret = PyList_New(0);
+    for (l = list; l; l = l->next) {
+	char *content_type = l->data;
+	PyObject *string = PyString_FromString(content_type);
+	PyList_Append(ret, string);
+	Py_DECREF(string);
+	g_free(content_type);
+    }
+    g_list_free(list);
+
+    return ret;
+}

Modified: trunk/gio/gvolumemonitor.override
==============================================================================
--- trunk/gio/gvolumemonitor.override	(original)
+++ trunk/gio/gvolumemonitor.override	Wed Aug 27 21:28:15 2008
@@ -35,6 +35,7 @@
     PyObject *item = pygobject_new((GObject *)drive);
     PyList_Append(ret, item);
     Py_DECREF(item);
+    g_object_unref(drive);
   }
   g_list_free(list);
   
@@ -56,6 +57,7 @@
     PyObject *item = pygobject_new((GObject *)volume);
     PyList_Append(ret, item);
     Py_DECREF(item);
+    g_object_unref(volume);
   }
   g_list_free(list);
   
@@ -77,6 +79,7 @@
     PyObject *item = pygobject_new((GObject *)mount);
     PyList_Append(ret, item);
     Py_DECREF(item);
+    g_object_unref(mount);
   }
   g_list_free(list);
   



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]