MCPcopy Create free account
hub / github.com/astonbitecode/j4rs / delete_java_local_ref

Function delete_java_local_ref

rust/src/jni_utils.rs:253–270  ·  view source on GitHub ↗

Deletes the java ref from the memory

(jni_env: *mut JNIEnv, jinstance: jobject)

Source from the content-addressed store, hash-verified

251
252/// Deletes the java ref from the memory
253pub(crate) fn delete_java_local_ref(jni_env: *mut JNIEnv, jinstance: jobject) {
254 unsafe {
255 let dlr = (**jni_env).v1_6.DeleteLocalRef;
256 let exc = (**jni_env).v1_6.ExceptionCheck;
257 let exd = (**jni_env).v1_6.ExceptionDescribe;
258 let exclear = (**jni_env).v1_6.ExceptionClear;
259 dlr(jni_env, jinstance);
260 if (exc)(jni_env) == JNI_TRUE {
261 if logger::is_console_debug_enabled() {
262 (exd)(jni_env);
263 }
264 (exclear)(jni_env);
265 error(
266 "An Exception was thrown by Java... Please check the logs or the console.",
267 );
268 }
269 }
270}
271
272pub(crate) fn global_jobject_from_str(
273 string: &str,

Callers 4

invoke_staticMethod · 0.85
to_rust_boxedMethod · 0.85
get_throwable_stringMethod · 0.85

Calls 2

is_console_debug_enabledFunction · 0.85
errorFunction · 0.85

Tested by

no test coverage detected