diff --git a/td/telegram/Client.cpp b/td/telegram/Client.cpp index c4a50c53d..e2ca351a4 100644 --- a/td/telegram/Client.cpp +++ b/td/telegram/Client.cpp @@ -127,6 +127,7 @@ class ClientManager::Impl final { response.object->get_id() == td_api::updateAuthorizationState::ID && static_cast(response.object.get())->authorization_state_->get_id() == td_api::authorizationStateClosed::ID) { + auto guard = concurrent_scheduler_->get_main_guard(); auto it = tds_.find(response.client_id); CHECK(it != tds_.end()); it->second.reset();