Implement close

This commit is contained in:
김선우 2025-02-09 18:40:50 +09:00
parent d51c1dc5b1
commit e0b0a667bb

View file

@ -21,7 +21,6 @@ impl LimboDB {
Box::into_raw(Box::new(self)) as jlong
}
#[allow(dead_code)]
pub fn drop(ptr: jlong) {
let _boxed = unsafe { Box::from_raw(ptr as *mut LimboDB) };
}
@ -97,6 +96,15 @@ pub extern "system" fn Java_org_github_tursodatabase_core_LimboDB_connect0<'loca
conn.to_ptr()
}
#[no_mangle]
pub extern "system" fn Java_org_github_tursodatabase_core_LimboDB_close0<'local>(
_env: JNIEnv<'local>,
_obj: JObject<'local>,
db_pointer: jlong
) {
LimboDB::drop(db_pointer);
}
#[no_mangle]
pub extern "system" fn Java_org_github_tursodatabase_core_LimboDB_throwJavaException<'local>(
mut env: JNIEnv<'local>,