mirror of
https://github.com/chatmail/core.git
synced 2026-09-22 13:01:21 +03:00
refactor: reduce the scope of unsafe in dc_context_unref()
This commit is contained in:
@@ -194,13 +194,11 @@ pub unsafe extern "C" fn dc_context_is_open(context: *mut dc_context_t) -> libc:
|
||||
/// This function releases the memory of the `dc_context_t` structure.
|
||||
#[unsafe(no_mangle)]
|
||||
pub unsafe extern "C" fn dc_context_unref(context: *mut dc_context_t) {
|
||||
unsafe {
|
||||
if context.is_null() {
|
||||
eprintln!("ignoring careless call to dc_context_unref()");
|
||||
return;
|
||||
}
|
||||
drop(Box::from_raw(context));
|
||||
}
|
||||
drop(unsafe { Box::from_raw(context) });
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
|
||||
Reference in New Issue
Block a user