SWIGTYPE out typemap mod to fix memory leak
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7056 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
2287a2c8e4
commit
e2da751502
1 changed files with 2 additions and 2 deletions
|
|
@ -139,13 +139,13 @@ strarray_inout(char [ANY])
|
|||
#ifdef __cplusplus
|
||||
{
|
||||
$&1_ltype resultobj = new $1_ltype(($1_ltype &) $1);
|
||||
SWIG_SetPointerZval(return_value, (void *)resultobj, $&1_descriptor, $owner);
|
||||
SWIG_SetPointerZval(return_value, (void *)resultobj, $&1_descriptor, 1);
|
||||
}
|
||||
#else
|
||||
{
|
||||
$&1_ltype resultobj = ($&1_ltype) emalloc(sizeof($1_type));
|
||||
memmove(resultobj, &$1, sizeof($1_type));
|
||||
SWIG_SetPointerZval(return_value, (void *)resultobj, $&1_descriptor, $owner);
|
||||
SWIG_SetPointerZval(return_value, (void *)resultobj, $&1_descriptor, 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue