summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2010-09-26 12:37:19 -0300
committerJohan Dahlin <johan@gnome.org>2010-09-26 12:37:19 -0300
commit478b318909b01d5269407df1d274c77720cde05b (patch)
tree60b7212432ee3a5f7598d11a7c600f0bc9853809
parent99ab8df51ef28940a4da5827263f498065634411 (diff)
downloadgobject-introspection-478b318909b01d5269407df1d274c77720cde05b.tar.gz
[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.
-rw-r--r--giscanner/giscannermodule.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/giscanner/giscannermodule.c b/giscanner/giscannermodule.c
index de65d6f3..aea9d907 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);