Set close_flag before clearing requests.

This commit is contained in:
levlam 2024-02-01 14:59:55 +03:00
parent f11c4e8af4
commit d120d0ab66

View File

@ -3421,10 +3421,10 @@ void Td::close_impl(bool destroy_flag) {
LOG(WARNING) << (destroy_flag ? "Destroy" : "Close") << " Td in state " << static_cast<int32>(state_);
if (state_ == State::WaitParameters) {
clear_requests();
state_ = State::Close;
close_flag_ = 4;
G()->set_close_flag();
clear_requests();
send_update(td_api::make_object<td_api::updateAuthorizationState>(
td_api::make_object<td_api::authorizationStateClosing>()));