mirror of
https://github.com/chatmail/core.git
synced 2026-05-06 06:46:35 +03:00
ffi: remove dc_is_io_running()
It is misleading and should never be checked. dc_stop_io() also stops pending ephemeral message deletion tasks, so it should be called in any case before releasing context.
This commit is contained in:
committed by
link2xt
parent
ebccdbbcb9
commit
8412affe37
@@ -532,7 +532,6 @@ int dc_is_configured (const dc_context_t* context);
|
||||
/**
|
||||
* Start job and IMAP/SMTP tasks.
|
||||
* If IO is already running, nothing happens.
|
||||
* To check the current IO state, use dc_is_io_running().
|
||||
*
|
||||
* If the context was created by the dc_accounts_t account manager,
|
||||
* use dc_accounts_start_io() instead of this function.
|
||||
@@ -542,20 +541,10 @@ int dc_is_configured (const dc_context_t* context);
|
||||
*/
|
||||
void dc_start_io (dc_context_t* context);
|
||||
|
||||
/**
|
||||
* Check if IO (SMTP/IMAP/Jobs) has been started.
|
||||
*
|
||||
* @memberof dc_context_t
|
||||
* @param context The context object.
|
||||
* @return 1=IO is running;
|
||||
* 0=IO is not running.
|
||||
*/
|
||||
int dc_is_io_running(const dc_context_t* context);
|
||||
|
||||
/**
|
||||
* Stop job, IMAP, SMTP and other tasks and return when they
|
||||
* are finished.
|
||||
* To check the current IO state, use dc_is_io_running().
|
||||
*
|
||||
* Even if IO is not running, there may be pending tasks,
|
||||
* so this function should always be called before releasing
|
||||
* context to ensure clean termination of event loop.
|
||||
|
||||
@@ -296,16 +296,6 @@ pub unsafe extern "C" fn dc_start_io(context: *mut dc_context_t) {
|
||||
block_on(ctx.start_io())
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn dc_is_io_running(context: *mut dc_context_t) -> libc::c_int {
|
||||
if context.is_null() {
|
||||
return 0;
|
||||
}
|
||||
let ctx = &*context;
|
||||
|
||||
block_on(ctx.is_io_running()) as libc::c_int
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn dc_get_id(context: *mut dc_context_t) -> libc::c_int {
|
||||
if context.is_null() {
|
||||
|
||||
Reference in New Issue
Block a user