Skip to content

Commit 1fb596c

Browse files
Merge pull request #104 from pickleburger/bugfix
let Jvm live longer
2 parents a6d3325 + fb13f19 commit 1fb596c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rust/src/async_api/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ impl Jvm {
6969

7070
// Create and return the Instance
7171
let instance = rx.await?;
72-
let new_jni_env = Jvm::attach_thread()?.jni_env;
72+
let new_jvm = Jvm::attach_thread()?;
73+
let new_jni_env = new_jvm.jni_env;
7374
Self::do_return(new_jni_env, instance)?
7475
}
7576

0 commit comments

Comments
 (0)