SWIGTYPE out typemap fix - Perl should always take ownership of the memory
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7055 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
42367f2348
commit
2287a2c8e4
1 changed files with 2 additions and 2 deletions
|
|
@ -148,14 +148,14 @@
|
||||||
{
|
{
|
||||||
$&1_ltype resultobj = new $1_ltype(($1_ltype &)$1);
|
$&1_ltype resultobj = new $1_ltype(($1_ltype &)$1);
|
||||||
ST(argvi) = sv_newmortal();
|
ST(argvi) = sv_newmortal();
|
||||||
SWIG_MakePtr(ST(argvi++), (void *) resultobj, $&1_descriptor, $shadow|$owner);
|
SWIG_MakePtr(ST(argvi++), (void *) resultobj, $&1_descriptor, $shadow|SWIG_OWNER);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
$&1_ltype resultobj = ($&1_ltype) malloc(sizeof($1_type));
|
$&1_ltype resultobj = ($&1_ltype) malloc(sizeof($1_type));
|
||||||
memmove(resultobj, &$1, sizeof($1_type));
|
memmove(resultobj, &$1, sizeof($1_type));
|
||||||
ST(argvi) = sv_newmortal();
|
ST(argvi) = sv_newmortal();
|
||||||
SWIG_MakePtr(ST(argvi++), (void *) resultobj, $&1_descriptor, $shadow|$owner);
|
SWIG_MakePtr(ST(argvi++), (void *) resultobj, $&1_descriptor, $shadow|SWIG_OWNER);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue