Fix race in on_alarm_timeout.
GitOrigin-RevId: 0a940296688cf4b743c85fa4513504483cd357df
This commit is contained in:
parent
b5e95821ad
commit
47c67479b3
@ -3062,9 +3062,13 @@ void Td::on_alarm_timeout(int64 alarm_id) {
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (close_flag_ >= 2) {
|
||||
// pending_alarms_ was already cleared
|
||||
return;
|
||||
}
|
||||
|
||||
auto it = pending_alarms_.find(alarm_id);
|
||||
CHECK(it != pending_alarms_.end()) << alarm_id << ' ' << close_flag_ << ' ' << G()->close_flag();
|
||||
CHECK(it != pending_alarms_.end());
|
||||
uint64 request_id = it->second;
|
||||
pending_alarms_.erase(alarm_id);
|
||||
send_result(request_id, make_tl_object<td_api::ok>());
|
||||
|
Reference in New Issue
Block a user