* tests/gc/native.c: Likewise.
public class NativeGlobalRef {
public native static void setReference(Object o);
public native static Object getReference();
+ public native static void delReference();
public static void main(String args[]) {
Object o;
/* is the object still there? */
o = getReference();
System.out.println(o);
+
+ /* delete the reference inside the native world */
+ delReference();
}
}
return ref;
}
+
+JNIEXPORT void JNICALL Java_NativeGlobalRef_delReference(JNIEnv *env, jclass c)
+{
+ printf("Native-World: delReference()\n");
+
+ (*env)->DeleteGlobalRef(env, ref);
+
+ return;
+}