[pygobject/gsoc2009: 95/160] Refactor _wrap_g_object_info_get_parent
- From: Simon van der Linden <svdlinden src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pygobject/gsoc2009: 95/160] Refactor _wrap_g_object_info_get_parent
- Date: Fri, 14 Aug 2009 21:31:04 +0000 (UTC)
commit e91043de7a3ed7a3fd70f39019e4689f4999f3f9
Author: Simon van der Linden <svdlinden src gnome org>
Date: Mon Aug 3 15:31:33 2009 +0200
Refactor _wrap_g_object_info_get_parent
gi/pygiinfo.c | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/gi/pygiinfo.c b/gi/pygiinfo.c
index 9cac53b..5a8df13 100644
--- a/gi/pygiinfo.c
+++ b/gi/pygiinfo.c
@@ -1200,17 +1200,20 @@ PYGIINFO_DEFINE_TYPE("ObjectInfo", GIObjectInfo, PyGIRegisteredTypeInfo_Type);
static PyObject *
_wrap_g_object_info_get_parent(PyGIBaseInfo *self)
{
- GIObjectInfo *parent_info;
+ GIBaseInfo *info;
+ PyObject *py_info;
- g_base_info_ref(self->info);
- parent_info = g_object_info_get_parent((GIObjectInfo*)self->info);
- g_base_info_unref(self->info);
+ info = (GIBaseInfo *)g_object_info_get_parent((GIObjectInfo*)self->info);
- if (parent_info)
- return pyg_info_new(parent_info);
+ if (info == NULL) {
+ Py_RETURN_NONE;
+ }
- Py_INCREF(Py_None);
- return Py_None;
+ py_info = pyg_info_new(info);
+
+ g_base_info_unref(info);
+
+ return py_info;
}
static PyObject *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]