summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Starodubtsev <andrey.starodubtsev@gmail.com>2017-01-22 18:14:38 +0300
committerAndrey Starodubtsev <andrey.starodubtsev@gmail.com>2017-01-22 18:14:38 +0300
commit519f296579f4a781352fe8c8f1d9ec0ef9559096 (patch)
treee56101a5ded3b5d573887e29531f3a0f170ccea0
parent7cb26631327327a4f8a61fef6ddca6a7854728ef (diff)
downloadswig-519f296579f4a781352fe8c8f1d9ec0ef9559096.tar.gz
WIP: #704 (java directorargout + java/typemaps.i fixes)
- failed tests fixed
-rw-r--r--Lib/java/java.swg8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/java/java.swg b/Lib/java/java.swg
index a32941176..cd61a2a94 100644
--- a/Lib/java/java.swg
+++ b/Lib/java/java.swg
@@ -1364,11 +1364,11 @@ SWIG_PROXY_CONSTRUCTOR(true, true, SWIGTYPE)
if (!$input) return $null;
JCALL4(SetByteArrayRegion, jenv, $input, 0, (jsize)$2, (jbyte *)$1);
}
- Swig::LocalRefGuard $refguard(jenv, $input);
+ Swig::LocalRefGuard $1_refguard(jenv, $input);
+}
+%typemap(directorargout) (char *STRING, size_t LENGTH) {
+ if ($input && $1) (jenv)->GetByteArrayRegion($input, 0, (jsize)$2, (jbyte *)$1);
}
-%typemap(directorargout) (char *STRING, size_t LENGTH)
-%{(jenv)->GetByteArrayRegion($input, 0, (jsize)$2, (jbyte *)$1);
-(jenv)->DeleteLocalRef($input);%}
%typemap(javadirectorin, descriptor="[B") (char *STRING, size_t LENGTH) "$jniinput"
%apply (char *STRING, size_t LENGTH) { (char *STRING, int LENGTH) }