mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
Revert back to only ffi-level checking of open context
The Rust context is always open, the return value of this function was simply the wrong way around.
This commit is contained in:
committed by
holger krekel
parent
8520b5211a
commit
8b7cd2dd1a
@@ -276,9 +276,11 @@ pub unsafe extern "C" fn dc_is_open(context: *mut dc_context_t) -> libc::c_int {
|
||||
return 0;
|
||||
}
|
||||
let ffi_context = &*context;
|
||||
ffi_context
|
||||
.with_inner(|ctx| ctx.sql.is_open() as libc::c_int)
|
||||
.unwrap_or(0)
|
||||
let inner_guard = ffi_context.inner.read().unwrap();
|
||||
match *inner_guard {
|
||||
Some(_) => 1,
|
||||
None => 0,
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
||||
Reference in New Issue
Block a user