mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-18 14:35:14 +01:00
Implement limbo close()
This commit is contained in:
@@ -12,7 +12,6 @@ use std::rc::Rc;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[derive(Clone)]
|
||||
#[allow(dead_code)]
|
||||
pub struct LimboConnection {
|
||||
// Because java's LimboConnection is 1:1 mapped to limbo connection, we can use Rc
|
||||
pub(crate) conn: Rc<Connection>,
|
||||
@@ -29,7 +28,6 @@ impl LimboConnection {
|
||||
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 LimboConnection) };
|
||||
}
|
||||
@@ -43,6 +41,15 @@ pub fn to_limbo_connection(ptr: jlong) -> Result<&'static mut LimboConnection> {
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "system" fn Java_org_github_tursodatabase_core_LimboConnection__1close<'local>(
|
||||
_env: JNIEnv<'local>,
|
||||
_obj: JObject<'local>,
|
||||
connection_ptr: jlong,
|
||||
) {
|
||||
LimboConnection::drop(connection_ptr);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "system" fn Java_org_github_tursodatabase_core_LimboConnection_prepareUtf8<'local>(
|
||||
mut env: JNIEnv<'local>,
|
||||
|
||||
Reference in New Issue
Block a user