Skip to content

Commit

Permalink
#65: Changes for Android
Browse files Browse the repository at this point in the history
  • Loading branch information
astonbitecode committed Mar 1, 2024
1 parent cfbcecc commit 27eec12
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rust/src/api_tweaks/android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,14 @@ pub(crate) fn find_class(env: *mut JNIEnv, classname: &str) -> errors::Result<jc
let found = match CLASSES.lock() {
Ok(g) => match g.get(classname) {
Some(j4rs_class) => Some(j4rs_class.class.clone()),
None => ((**env).FindClass).map(|fc| {
None => {
let fc = (**env).v1_6.FindClass;
let cstr = utils::to_c_string(classname);
let found: jclass = (fc)(env, cstr);
add_to_cache = true;
utils::drop_c_string(cstr);
found
}),
Some(found)
},
},
Err(error) => {
error!("Could not get the lock for the jclass cache: {:?}", error);
Expand Down

0 comments on commit 27eec12

Please sign in to comment.