From 0268b8b446fcff93971c1d0dd3b188b3cb5436d9 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Fri, 23 Apr 2004 16:32:51 +0000 Subject: Fixed lurking bug in native array copying code generation if more than one array needed to be copied git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@122 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/net/java/games/gluegen/CMethodBindingEmitter.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/net/java/games/gluegen') diff --git a/src/net/java/games/gluegen/CMethodBindingEmitter.java b/src/net/java/games/gluegen/CMethodBindingEmitter.java index e72c0ab77..e65b8ca00 100644 --- a/src/net/java/games/gluegen/CMethodBindingEmitter.java +++ b/src/net/java/games/gluegen/CMethodBindingEmitter.java @@ -721,7 +721,14 @@ public class CMethodBindingEmitter extends FunctionEmitter } writer.println(" /* Clean up " + convName + "_copy */"); + + // Re-fetch length of array that was copied String arrayLenName = "_tmpArrayLen"; + writer.print(" "); + writer.print(arrayLenName); + writer.print(" = (*env)->GetArrayLength(env, "); + writer.print(binding.getArgumentName(i)); + writer.println(");"); // free each element PointerType cArgPtrType = cArgType.asPointer(); -- cgit v1.2.3