in src/main/c/h3-java/src/jniapi.c [86:107]
void JNI_OnUnload(JavaVM *vm, void *reserved) {
JNIEnv *env;
if ((**vm).GetEnv(vm, (void **)&env, JNI_VERSION_1_6) != JNI_OK) {
// Something is wrong but nothing we can do about this :(
return;
} else {
// delete global references so the GC can collect them
if (com_uber_h3core_exceptions_H3Exception != NULL) {
(**env).DeleteGlobalRef(env,
com_uber_h3core_exceptions_H3Exception);
}
if (java_lang_OutOfMemoryError != NULL) {
(**env).DeleteGlobalRef(env, java_lang_OutOfMemoryError);
}
if (java_util_ArrayList != NULL) {
(**env).DeleteGlobalRef(env, java_util_ArrayList);
}
if (com_uber_h3core_util_LatLng != NULL) {
(**env).DeleteGlobalRef(env, com_uber_h3core_util_LatLng);
}
}
}