fix memory PyObject * typemaps to avoid memory leaks with iterators
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8375 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
07011f2e95
commit
5daf66c0db
4 changed files with 30 additions and 4 deletions
|
|
@ -85,13 +85,18 @@
|
|||
|
||||
/* For output, we increase the reference object */
|
||||
%typemap(out,noblock=1) PyObject * {
|
||||
Py_XINCREF($1);
|
||||
/* hello */
|
||||
$result = $1;
|
||||
%#if !($owner)
|
||||
Py_XINCREF($result);
|
||||
%#endif
|
||||
}
|
||||
|
||||
%typemap(out,noblock=1) PyObject * const & {
|
||||
Py_XINCREF(*$1);
|
||||
$result = *$1;
|
||||
%#if !($owner)
|
||||
Py_XINCREF($result);
|
||||
%#endif
|
||||
}
|
||||
|
||||
/* Consttab, needed for callbacks, it should be removed later */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue