Deletes the java ref from the memory
(jni_env: *mut JNIEnv, jinstance: jobject)
| 231 | |
| 232 | /// Deletes the java ref from the memory |
| 233 | pub fn delete_java_ref(jni_env: *mut JNIEnv, jinstance: jobject) { |
| 234 | unsafe { |
| 235 | let dgr = (**jni_env).v1_6.DeleteGlobalRef; |
| 236 | let exc = (**jni_env).v1_6.ExceptionCheck; |
| 237 | let exd = (**jni_env).v1_6.ExceptionDescribe; |
| 238 | let exclear = (**jni_env).v1_6.ExceptionClear; |
| 239 | dgr(jni_env, jinstance); |
| 240 | if (exc)(jni_env) == JNI_TRUE { |
| 241 | if logger::is_console_debug_enabled() { |
| 242 | (exd)(jni_env); |
| 243 | } |
| 244 | (exclear)(jni_env); |
| 245 | error( |
| 246 | "An Exception was thrown by Java... Please check the logs or the console.", |
| 247 | ); |
| 248 | } |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | /// Deletes the java ref from the memory |
| 253 | pub(crate) fn delete_java_local_ref(jni_env: *mut JNIEnv, jinstance: jobject) { |
no test coverage detected