From 131e62dcb86fe8b02f0ae989b3f8bfc5b0e57c7d Mon Sep 17 00:00:00 2001 From: Frederic Peters Date: Tue, 29 Apr 2008 12:05:16 +0000 Subject: [project @ fpeters@0d.be-20071113140738-l9xdpgnjvx2ekdvr] PyDict_SetItemString doesn't steal the reference, so Py_DECREF(obj); after. Original author: Frederic Peters Date: 2007-11-13 15:07:38.745000+01:00 --- bindings/lang_python_wrapper_top.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bindings/lang_python_wrapper_top.c') diff --git a/bindings/lang_python_wrapper_top.c b/bindings/lang_python_wrapper_top.c index 10ce0352..2ae93296 100644 --- a/bindings/lang_python_wrapper_top.c +++ b/bindings/lang_python_wrapper_top.c @@ -75,6 +75,7 @@ get_dict_from_hashtable_of_strings(GHashTable *value) if (item_value) { item = PyString_FromString(item_value); PyDict_SetItemString(dict, (char*)keys->data, item); + Py_DECREF(item); } else { PyDict_SetItemString(dict, (char*)keys->data, Py_None); } @@ -100,6 +101,7 @@ get_dict_from_hashtable_of_objects(GHashTable *value) if (item_value) { item = PyGObjectPtr_New(G_OBJECT(item_value)); PyDict_SetItemString(dict, (char*)keys->data, item); + Py_DECREF(item); } else { PyDict_SetItemString(dict, (char*)keys->data, Py_None); } -- cgit