diff --git a/SWIG/Lib/java/java.swg b/SWIG/Lib/java/java.swg index 8836e1450..74ed4a72a 100644 --- a/SWIG/Lib/java/java.swg +++ b/SWIG/Lib/java/java.swg @@ -348,8 +348,7 @@ $1 = &temp; %} $1 = *argp; %} %typemap(out) SWIGTYPE #ifdef __cplusplus -%{$&1_ltype $1ptr = new $1_ltype(($1_ltype &)$1); - *($&1_ltype*)&$result = $1ptr; %} +%{*($&1_ltype*)&$result = new $1_ltype(($1_ltype &)$1); %} #else { $&1_ltype $1ptr = ($&1_ltype) malloc(sizeof($1_ltype));