diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-09-11 10:32:04 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.lima@openbossa.org> | 2012-09-11 15:35:47 +0200 |
commit | 6df4b307c5aec758ad954ab8717f5e85b44e2ae5 (patch) | |
tree | c15a3a2f4acc1a52af123ce109990588c16a5b5d /PySide | |
parent | 5f72daadde1b99305d3e28da0952958581439414 (diff) |
Fix reference leak on convertion from a C++ map type to Python dict.
Patch by Dennis Victorovich.
Change-Id: I050da20f6c0bef2f568aefcc81a9a159a412be24
Reviewed-by: Hugo Parente Lima <hugo.lima@openbossa.org>
Diffstat (limited to 'PySide')
-rw-r--r-- | PySide/QtCore/typesystem_core_common.xml | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/PySide/QtCore/typesystem_core_common.xml b/PySide/QtCore/typesystem_core_common.xml index d7d0dd9a4..888865838 100644 --- a/PySide/QtCore/typesystem_core_common.xml +++ b/PySide/QtCore/typesystem_core_common.xml @@ -658,9 +658,11 @@ for (; it != %in.end(); ++it) { %INTYPE_0 key = it.key(); %INTYPE_1 value = it.value(); - PyDict_SetItem(%out, - %CONVERTTOPYTHON[%INTYPE_0](key), - %CONVERTTOPYTHON[%INTYPE_1](value)); + PyObject* pyKey = %CONVERTTOPYTHON[%INTYPE_0](key); + PyObject* pyValue = %CONVERTTOPYTHON[%INTYPE_1](value); + PyDict_SetItem(%out, pyKey, pyValue); + Py_DECREF(pyKey); + Py_DECREF(pyValue); } return %out; </template> |