mirror of
https://github.com/chatmail/core.git
synced 2026-04-24 17:06:28 +03:00
fix closing segfault
thanks again to link2xt for figguring this out
This commit is contained in:
@@ -2936,7 +2936,8 @@ NAPI_METHOD(dcn_accounts_unref) {
|
|||||||
dcn_accounts->event_handler_thread = 0;
|
dcn_accounts->event_handler_thread = 0;
|
||||||
}
|
}
|
||||||
if (dcn_accounts->jsonrpc_instance) {
|
if (dcn_accounts->jsonrpc_instance) {
|
||||||
dc_json_api_unref(dcn_accounts->jsonrpc_instance);
|
dc_json_request(dcn_accounts->jsonrpc_instance, "{}");
|
||||||
|
uv_thread_join(&dcn_accounts->jsonrpc_thread);
|
||||||
dcn_accounts->jsonrpc_instance = NULL;
|
dcn_accounts->jsonrpc_instance = NULL;
|
||||||
}
|
}
|
||||||
dc_accounts_unref(dcn_accounts->dc_accounts);
|
dc_accounts_unref(dcn_accounts->dc_accounts);
|
||||||
@@ -3255,10 +3256,6 @@ static void accounts_jsonrpc_thread_func(void* arg)
|
|||||||
TRACE("accounts_jsonrpc_thread_func starting");
|
TRACE("accounts_jsonrpc_thread_func starting");
|
||||||
char* response;
|
char* response;
|
||||||
while (true) {
|
while (true) {
|
||||||
if (dcn_accounts->jsonrpc_instance == NULL) {
|
|
||||||
TRACE("jsonrpc is null, bailing");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
response = dc_get_next_json_response(dcn_accounts->jsonrpc_instance);
|
response = dc_get_next_json_response(dcn_accounts->jsonrpc_instance);
|
||||||
if (response == NULL) {
|
if (response == NULL) {
|
||||||
// done or broken
|
// done or broken
|
||||||
|
|||||||
Reference in New Issue
Block a user