diff --git a/td/telegram/files/FileManager.cpp b/td/telegram/files/FileManager.cpp index 65e64a76..67cadce8 100644 --- a/td/telegram/files/FileManager.cpp +++ b/td/telegram/files/FileManager.cpp @@ -3701,7 +3701,14 @@ void FileManager::memory_cleanup() { if (file_id_info_.size() > 1000) { for (unsigned int i = 1; i < file_id_info_.size() - 1000; i++) { empty_file_ids_.push_back(i); - } + } + + while (!queries_container_.empty()) { + auto ids = queries_container_.ids(); + for (auto id : ids) { + on_error(id, Status::Error(500, "Request aborted")); + } + } } }