diff options
author | Marcelo Matus <mmatus@acms.arizona.edu> | 2005-11-21 20:58:31 +0000 |
---|---|---|
committer | Marcelo Matus <mmatus@acms.arizona.edu> | 2005-11-21 20:58:31 +0000 |
commit | af0aab45d7f51ff71b8fafa09641b1471913c732 (patch) | |
tree | ec06ef5f55bc58c6714f6ccd47c32069f2f77c17 /Lib/python/std_map.i | |
parent | 0994c45ede9218aad9d695164ab375d9f372d464 (diff) | |
download | swig-af0aab45d7f51ff71b8fafa09641b1471913c732.tar.gz |
fix memory leaking
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7859 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Lib/python/std_map.i')
-rw-r--r-- | Lib/python/std_map.i | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/python/std_map.i b/Lib/python/std_map.i index 576d03569..7baea64b0 100644 --- a/Lib/python/std_map.i +++ b/Lib/python/std_map.i @@ -47,9 +47,9 @@ } PyObject *obj = PyDict_New(); for (const_iterator i= map.begin(); i!= map.end(); ++i) { - PyDict_SetItem(obj, - swig::from(i->first), - swig::from(i->second)); + swig::PyObject_var key = swig::from(i->first); + swig::PyObject_var val = swig::from(i->second); + PyDict_SetItem(obj, key, val); } return obj; } |