Skip to content

Commit 627dddb

Browse files
wuwbobo2021Dirbaio
authored andcommitted
Fix Monitor under current branch
1 parent 289c7d3 commit 627dddb

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

java-spaghetti/src/refs/ref_.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,10 @@ impl<'env, T: ReferenceType> Drop for Monitor<'env, T> {
197197
let jnienv = env.as_raw();
198198
let result = unsafe { ((**jnienv).v1_2.MonitorExit)(jnienv, self.inner.as_raw()) };
199199
assert!(result == jni_sys::JNI_OK);
200-
if let Err(exception) = env.exception_check_raw() {
201-
panic!(
202-
"exception happened calling JNI MonitorExit, the monitor is probably broken previously: {}",
203-
unsafe { env.raw_exception_to_string(exception) }
204-
);
205-
}
200+
let exception = unsafe { ((**jnienv).v1_2.ExceptionOccurred)(jnienv) };
201+
assert!(
202+
exception.is_null(),
203+
"exception happened calling JNI MonitorExit, the monitor is probably broken previously"
204+
);
206205
}
207206
}

0 commit comments

Comments
 (0)