Fix directorin SWIGTYPE typemaps to make a copy as these are used for pass by value.

Closes #434
This commit is contained in:
William S Fulton 2016-05-14 21:19:14 +01:00
commit 98a31ff633
15 changed files with 180 additions and 14 deletions

View file

@ -647,8 +647,8 @@ SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
%typemap(directorin,descriptor="L$packagepath/$&javaclassname;") SWIGTYPE
%{ $input = 0;
*(($&1_ltype*)&$input) = &$1; %}
%typemap(javadirectorin) SWIGTYPE "new $&javaclassname($jniinput, false)"
*(($&1_ltype*)&$input) = new $1_ltype((const $1_ltype &)$1); %}
%typemap(javadirectorin) SWIGTYPE "new $&javaclassname($jniinput, true)"
%typemap(javadirectorout) SWIGTYPE "$&javaclassname.getCPtr($javacall)"
/* Generic pointers and references */