summaryrefslogtreecommitdiffstats
path: root/bindings/lang_python_wrapper_top.c
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@entrouvert.com>2008-04-29 12:05:16 +0000
committerFrederic Peters <fpeters@entrouvert.com>2008-04-29 12:05:16 +0000
commit131e62dcb86fe8b02f0ae989b3f8bfc5b0e57c7d (patch)
tree70d77512f4aee5e98d886d2e038ba189a6c1d9b1 /bindings/lang_python_wrapper_top.c
parent0ac403922ffc4126f21e48dddd0c38076257ca74 (diff)
downloadlasso-131e62dcb86fe8b02f0ae989b3f8bfc5b0e57c7d.tar.gz
lasso-131e62dcb86fe8b02f0ae989b3f8bfc5b0e57c7d.tar.xz
lasso-131e62dcb86fe8b02f0ae989b3f8bfc5b0e57c7d.zip
[project @ fpeters@0d.be-20071113140738-l9xdpgnjvx2ekdvr]
PyDict_SetItemString doesn't steal the reference, so Py_DECREF(obj); after. Original author: Frederic Peters <fpeters@0d.be> Date: 2007-11-13 15:07:38.745000+01:00
Diffstat (limited to 'bindings/lang_python_wrapper_top.c')
-rw-r--r--bindings/lang_python_wrapper_top.c2
1 files changed, 2 insertions, 0 deletions
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);
}