#[unsafe(no_mangle)]
pub unsafe extern "system" fn {{ symbol }}(
mut env: EnvUnowned,
_class: JClass,
handle: jlong,
) {
// SAFETY: env is a valid EnvUnowned passed by the JVM for this native call frame.
let mut __jni_attach_guard = unsafe { jni::AttachGuard::from_unowned(env.as_raw()) };
let env = __jni_attach_guard.borrow_env_mut();
let Some(()) = run_or_throw(env, |_env| {
if handle == 0 { return; }
// SAFETY: `handle` was allocated by the matching constructor shim and
// ownership is transferred back here for drop via Box::from_raw.
unsafe { let _ = Box::from_raw(handle as *mut core_crate::{{ type_name }}); }
}) else {
return;
};
}