fix sigfault in "DESTROY NULL file_id_info_"

This commit is contained in:
andrew (from workstation) 2020-05-25 10:36:03 +02:00
parent c95a8c02aa
commit 88892a70c6
2 changed files with 3 additions and 3 deletions

View File

@ -911,6 +911,8 @@ class CliClient final : public Actor {
if (disable_network_) { if (disable_network_) {
send_request(td_api::make_object<td_api::setNetworkType>(td_api::make_object<td_api::networkTypeNone>())); send_request(td_api::make_object<td_api::setNetworkType>(td_api::make_object<td_api::networkTypeNone>()));
} }
on_cmd("v0");
} }
#ifndef USE_READLINE #ifndef USE_READLINE
size_t buffer_pos_ = 0; size_t buffer_pos_ = 0;
@ -4084,8 +4086,6 @@ class CliClient final : public Actor {
} }
#endif #endif
on_cmd("v0");
while (!cmd_queue_.empty() && !close_flag_) { while (!cmd_queue_.empty() && !close_flag_) {
auto cmd = std::move(cmd_queue_.front()); auto cmd = std::move(cmd_queue_.front());
cmd_queue_.pop(); cmd_queue_.pop();

View File

@ -3889,8 +3889,8 @@ void FileManager::memory_cleanup() {
auto it = file_id_info_.begin(); auto it = file_id_info_.begin();
while (it != file_id_info_.end()) { while (it != file_id_info_.end()) {
if (file_nodes_[it->second.node_id_].empty) { if (file_nodes_[it->second.node_id_].empty) {
file_id_info_.erase(it++);
context_->destroy_file_source({it->first, 0}); context_->destroy_file_source({it->first, 0});
file_id_info_.erase(it++);
} else { } else {
++it; ++it;
} }