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:
William S Fulton 2005-03-09 22:31:55 +00:00
commit 2287a2c8e4

View file

@ -148,14 +148,14 @@
{
$&1_ltype resultobj = new $1_ltype(($1_ltype &)$1);
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
{
$&1_ltype resultobj = ($&1_ltype) malloc(sizeof($1_type));
memmove(resultobj, &$1, sizeof($1_type));
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