From 842bf095b53bbed3424f969ae2c8ca91deb0e56a Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Mon, 21 Nov 2005 20:58:31 +0000 Subject: [PATCH] fix memory leaking git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7859 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Lib/python/std_map.i | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SWIG/Lib/python/std_map.i b/SWIG/Lib/python/std_map.i index 576d03569..7baea64b0 100644 --- a/SWIG/Lib/python/std_map.i +++ b/SWIG/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; }