The docs for the cffi function dc_jsonrpc_next_response say:
|
* If NULL is returned, the accounts_t belonging to the jsonrpc instance is unref'd and no more events will come; |
|
* in this case, free the jsonrpc instance using dc_jsonrpc_unref(). |
This is misleading because dc_jsonrpc_instance_t holds an Arc on Accounts, so it cannot happen that the underlying accounts_t has been dropped.
This sentence in the docs also suggests that for a clean shutdown you can just dc_accounts_unref to somehow unblock dc_jsonrpc_next_response which would then return NULL to then exit a dc_jsonrpc_next_response polling loop. But as far as I understand this will not work, for a clean shutdown it is necessary to manually unblock dc_jsonrpc_next_response by sending some request (like get_system_info) and then manually break the polling loop (e.g. based on a done flag which has been set when initiating the shutdown).
I think even just removing these two lines from the docs would improve comprehensibility.
The docs for the cffi function
dc_jsonrpc_next_responsesay:core/deltachat-ffi/deltachat.h
Lines 6004 to 6005 in 80acc9d
This is misleading because
dc_jsonrpc_instance_tholds anArconAccounts, so it cannot happen that the underlyingaccounts_thas been dropped.This sentence in the docs also suggests that for a clean shutdown you can just
dc_accounts_unrefto somehow unblockdc_jsonrpc_next_responsewhich would then returnNULLto then exit adc_jsonrpc_next_responsepolling loop. But as far as I understand this will not work, for a clean shutdown it is necessary to manually unblockdc_jsonrpc_next_responseby sending some request (likeget_system_info) and then manually break the polling loop (e.g. based on adoneflag which has been set when initiating the shutdown).I think even just removing these two lines from the docs would improve comprehensibility.