diff --git a/src/main/java/org/bytedeco/javacpp/tools/Generator.java b/src/main/java/org/bytedeco/javacpp/tools/Generator.java index e703ca31..c9ca9184 100644 --- a/src/main/java/org/bytedeco/javacpp/tools/Generator.java +++ b/src/main/java/org/bytedeco/javacpp/tools/Generator.java @@ -3031,7 +3031,7 @@ void parametersAfter(MethodInformation methodInfo) { // If const array, then use JNI_ABORT to avoid copying unmodified data back to JVM final String releaseArrayFlag; - if (cast.contains(" const *") || cast.startsWith("(const ")) { + if (cast.contains("* const") || cast.endsWith("const)")) { releaseArrayFlag = "JNI_ABORT"; } else { releaseArrayFlag = "0";