musikr: dont pass JObject ownership
90% sure this causes the JObject to be dropped incorrectly.
This commit is contained in:
parent
894e265a2c
commit
47604724a4
2 changed files with 3 additions and 3 deletions
|
@ -5,11 +5,11 @@ use std::io::SeekFrom;
|
|||
|
||||
pub struct JInputStream<'local> {
|
||||
env: SharedEnv<'local>,
|
||||
input: JObject<'local>,
|
||||
input: &'local JObject<'local>,
|
||||
}
|
||||
|
||||
impl<'local, 'a> JInputStream<'local> {
|
||||
pub fn new(env: SharedEnv<'local>, input: JObject<'local>) -> Self {
|
||||
pub fn new(env: SharedEnv<'local>, input: &'local JObject<'local>) -> Self {
|
||||
Self { env, input }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ pub extern "C" fn Java_org_oxycblt_musikr_metadata_MetadataJNI_openFile<'local>(
|
|||
) -> jobject {
|
||||
// Create JInputStream from the Java input stream
|
||||
let shared_env = Rc::new(RefCell::new(env));
|
||||
let stream = JInputStream::new(shared_env.clone(), input);
|
||||
let stream = JInputStream::new(shared_env.clone(), &input);
|
||||
let file_ref = FileRef::new(stream);
|
||||
let file = file_ref.file();
|
||||
let mut jbuilder = JMetadataBuilder::new(shared_env.clone());
|
||||
|
|
Loading…
Reference in a new issue