[pygobject/gsoc2009: 126/160] Use tp_alloc rather than PyType_GC_New



commit 88cafb804a4bae3ebda831c495f75b4033652fa1
Author: Simon van der Linden <svdlinden src gnome org>
Date:   Sat Aug 8 10:16:38 2009 +0200

    Use tp_alloc rather than PyType_GC_New

 gi/pygi-info.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/gi/pygi-info.c b/gi/pygi-info.c
index 94e278d..eb14e42 100644
--- a/gi/pygi-info.c
+++ b/gi/pygi-info.c
@@ -219,17 +219,13 @@ _pygi_info_new (GIBaseInfo *info)
             break;
     }
 
-    self = (PyGIBaseInfo *)PyObject_GC_New(PyGIBaseInfo, type);
+    self = (PyGIBaseInfo *)type->tp_alloc(type, 0);
     if (self == NULL) {
         return NULL;
     }
 
     self->info = g_base_info_ref(info);
 
-    self->inst_weakreflist = NULL;
-
-    PyObject_GC_Track((PyObject *)self);
-
     return (PyObject *)self;
 }
 



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