mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
node: stop IO on unref only if we own event loop
Otherwise unrefing context stops its IO even when we use account manager, e.g. in desktop client.
This commit is contained in:
@@ -371,8 +371,8 @@ NAPI_METHOD(dcn_context_unref) {
|
||||
|
||||
TRACE("Unrefing dc_context");
|
||||
dcn_context->gc = 1;
|
||||
dc_stop_io(dcn_context->dc_context);
|
||||
if (dcn_context->event_handler_thread != 0) {
|
||||
dc_stop_io(dcn_context->dc_context);
|
||||
uv_thread_join(&dcn_context->event_handler_thread);
|
||||
dcn_context->event_handler_thread = 0;
|
||||
}
|
||||
@@ -2927,8 +2927,8 @@ NAPI_METHOD(dcn_accounts_unref) {
|
||||
|
||||
TRACE("Unrefing dc_accounts");
|
||||
dcn_accounts->gc = 1;
|
||||
dc_accounts_stop_io(dcn_accounts->dc_accounts);
|
||||
if (dcn_accounts->event_handler_thread != 0) {
|
||||
dc_accounts_stop_io(dcn_accounts->dc_accounts);
|
||||
uv_thread_join(&dcn_accounts->event_handler_thread);
|
||||
dcn_accounts->event_handler_thread = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user