mirror of
https://github.com/chatmail/core.git
synced 2026-09-22 13:01:21 +03:00
api!: remove dc_chatlist_get_context()
This API is dangerous because returned pointer is only valid until the chatlist is freed, and may accidentally be passed into dc_context_unref().
This commit is contained in:
@@ -2872,18 +2872,6 @@ pub unsafe extern "C" fn dc_chatlist_get_summary2(
|
||||
Box::into_raw(Box::new(summary.into()))
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub unsafe extern "C" fn dc_chatlist_get_context(
|
||||
chatlist: *mut dc_chatlist_t,
|
||||
) -> *const dc_context_t {
|
||||
if chatlist.is_null() {
|
||||
eprintln!("ignoring careless call to dc_chatlist_get_context()");
|
||||
return ptr::null_mut();
|
||||
}
|
||||
let ffi_list = unsafe { &*chatlist };
|
||||
ffi_list.context
|
||||
}
|
||||
|
||||
// dc_chat_t
|
||||
|
||||
/// FFI struct for [dc_chat_t]
|
||||
|
||||
Reference in New Issue
Block a user