bind/java: initialize seq machinery from Java

This ensures that the java bindings are ready before any calls are
made by user code. As a bonus, the JNIEnv* is from the Seq class so I
believe no tricks are required to find the right class loader.

Fixes golang/go#10903.

Change-Id: I33b3b39cef6cc2da36e271de882ba8d26610ea34
Reviewed-on: https://go-review.googlesource.com/10296
Reviewed-by: Elias Naur <elias.naur@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This commit is contained in:
David Crawshaw
2015-05-28 18:37:54 +00:00
parent d2634ce9c5
commit 64c20ce93d
5 changed files with 16 additions and 43 deletions
+6
View File
@@ -66,6 +66,12 @@ public class Seq {
return tracker.get(refnum);
}
static {
initSeq();
}
static native void initSeq();
// Informs the Go ref tracker that Java is done with this ref.
static native void destroyRef(int refnum);