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

Function delete_java_ref

rust/src/jni_utils.rs:233–250  ·  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

231
232/// Deletes the java ref from the memory
233pub 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
253pub(crate) fn delete_java_local_ref(jni_env: *mut JNIEnv, jinstance: jobject) {

Callers 15

handle_channel_senderMethod · 0.85
dropMethod · 0.85
create_instanceMethod · 0.85
static_classMethod · 0.85
create_java_arrayMethod · 0.85
do_create_java_listMethod · 0.85
do_create_java_mapMethod · 0.85
invokeMethod · 0.85
fieldMethod · 0.85

Calls 2

is_console_debug_enabledFunction · 0.85
errorFunction · 0.85

Tested by

no test coverage detected