Fix directorout typemaps which were causing undefined behaviour when returning pointers by reference.
Closes #1167
This commit is contained in:
parent
224bb9e023
commit
e86c881a70
6 changed files with 24 additions and 7 deletions
|
|
@ -185,7 +185,9 @@
|
|||
%typemap(directorin) SWIGTYPE *const&
|
||||
"$input = (void *) $1;"
|
||||
%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE *const&
|
||||
"$result = ($1_ltype)&$input;"
|
||||
%{ static $*1_ltype swig_temp;
|
||||
swig_temp = ($*1_ltype)$input;
|
||||
$result = &swig_temp; %}
|
||||
%typemap(ddirectorin,
|
||||
nativepointer="cast($dtype)$winput"
|
||||
) SWIGTYPE *const& "($winput is null) ? null : new $*dclassname($winput, false)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue