[gobject-introspection] [sourcescanner] Plug a couple of python leaks



commit 478b318909b01d5269407df1d274c77720cde05b
Author: Johan Dahlin <johan gnome org>
Date:   Sun Sep 26 12:37:19 2010 -0300

    [sourcescanner] Plug a couple of python leaks
    
    There's no need to increase the reference count to
    items passed into PyList_SetItem, it already steals a reference.

 giscanner/giscannermodule.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/giscanner/giscannermodule.c b/giscanner/giscannermodule.c
index de65d6f..aea9d90 100644
--- a/giscanner/giscannermodule.c
+++ b/giscanner/giscannermodule.c
@@ -299,7 +299,6 @@ type_get_child_list (PyGISourceType *self,
     {
       PyObject *item = pygi_source_symbol_new (l->data);
       PyList_SetItem (list, i++, item);
-      Py_INCREF (item);
     }
 
   Py_INCREF (list);
@@ -512,7 +511,6 @@ pygi_source_scanner_get_symbols (PyGISourceScanner *self)
     {
       PyObject *item = pygi_source_symbol_new (l->data);
       PyList_SetItem (list, i++, item);
-      Py_INCREF (item);
     }
 
   Py_INCREF (list);
@@ -535,8 +533,7 @@ pygi_source_scanner_get_comments (PyGISourceScanner *self)
       PyObject *item = Py_BuildValue ("(ssi)", comment->comment,
                                       comment->filename,
                                       comment->line);
-      PyList_SET_ITEM (list, i++, item);
-      Py_INCREF (item);
+      PyList_SetItem (list, i++, item);
     }
 
   Py_INCREF (list);



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