Fix possible crash in application shutdown.

This commit is contained in:
John Preston 2023-03-17 21:05:27 +04:00
parent e4834f583f
commit bcb07110e0
3 changed files with 7 additions and 0 deletions

View File

@ -246,6 +246,11 @@ not_null<Dialogs::MainList*> ChatFilters::chatsList(FilterId filterId) {
return pointer.get();
}
void ChatFilters::clear() {
_chatsLists.clear();
_list.clear();
}
void ChatFilters::setPreloaded(const QVector<MTPDialogFilter> &result) {
_loadRequestId = -1;
received(result);

View File

@ -113,6 +113,7 @@ public:
void refreshHistory(not_null<History*> history);
[[nodiscard]] not_null<Dialogs::MainList*> chatsList(FilterId filterId);
void clear();
const ChatFilter &applyUpdatedPinned(
FilterId id,

View File

@ -388,6 +388,7 @@ void Session::clear() {
for (const auto &[id, folder] : _folders) {
folder->clearChatsList();
}
_chatsFilters->clear();
_histories->clearAll();
_webpages.clear();
_locations.clear();