diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 88ea53a1..38cfa2a9 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -8629,6 +8629,10 @@ void MessagesManager::set_dialog_online_member_count(DialogId dialog_id, int32 o } void MessagesManager::on_update_dialog_online_member_count_timeout(DialogId dialog_id) { + if (G()->close_flag()) { + return; + } + LOG(INFO) << "Expired timeout for online member count for " << dialog_id; Dialog *d = get_dialog(dialog_id); CHECK(d != nullptr); @@ -23269,6 +23273,7 @@ void MessagesManager::fix_new_dialog(Dialog *d, unique_ptr &&last_datab d->new_secret_chat_notification_id.get() <= d->message_notification_group.max_removed_notification_id.get()) { VLOG(notifications) << "Fix removing new secret chat " << d->new_secret_chat_notification_id << " in " << dialog_id; d->new_secret_chat_notification_id = NotificationId(); + on_dialog_updated(d->dialog_id, "fix new secret chat notification id"); } auto pending_it = pending_add_dialog_last_database_message_dependent_dialogs_.find(dialog_id); diff --git a/td/telegram/PollManager.cpp b/td/telegram/PollManager.cpp index e3706c21..6de9dd21 100644 --- a/td/telegram/PollManager.cpp +++ b/td/telegram/PollManager.cpp @@ -753,6 +753,9 @@ void PollManager::on_update_poll_timeout(PollId poll_id) { CHECK(!td_->auth_manager_->is_bot()); CHECK(!is_local_poll_id(poll_id)); + if (G()->close_flag()) { + return; + } if (get_poll_is_closed(poll_id)) { return; } diff --git a/td/telegram/Td.h b/td/telegram/Td.h index 6fc843ac..30e35c9c 100644 --- a/td/telegram/Td.h +++ b/td/telegram/Td.h @@ -205,6 +205,11 @@ class Td final : public NetQueryCallback { template std::shared_ptr create_handler(Args &&... args) { + LOG_CHECK(close_flag_ < 2) << close_flag_ +#if TD_CLANG || TD_GCC + << ' ' << __PRETTY_FUNCTION__ +#endif + ; auto ptr = std::make_shared(std::forward(args)...); ptr->set_td(this); return ptr;