mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Fix crash clearing chats list before histories.
This commit is contained in:
parent
13a9920c11
commit
d0c2bec925
4 changed files with 9 additions and 0 deletions
|
@ -381,6 +381,9 @@ void Session::clear() {
|
|||
cSetRecentInlineBots(RecentInlineBots());
|
||||
cSetRecentStickers(RecentStickerPack());
|
||||
HistoryView::Element::ClearGlobal();
|
||||
_contactsNoChatsList.clear();
|
||||
_contactsList.clear();
|
||||
_chatsList.clear();
|
||||
_histories->clearAll();
|
||||
_webpages.clear();
|
||||
_locations.clear();
|
||||
|
|
|
@ -205,6 +205,7 @@ void IndexedList::remove(Key key, Row *replacedBy) {
|
|||
}
|
||||
|
||||
void IndexedList::clear() {
|
||||
_list.clear();
|
||||
_index.clear();
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,10 @@ public:
|
|||
List &operator=(List &&other) = default;
|
||||
~List() = default;
|
||||
|
||||
void clear() {
|
||||
_rows.clear();
|
||||
_rowByKey.clear();
|
||||
}
|
||||
[[nodiscard]] int size() const {
|
||||
return _rows.size();
|
||||
}
|
||||
|
|
|
@ -81,6 +81,7 @@ void MainList::clear() {
|
|||
recomputeFullListSize();
|
||||
});
|
||||
const auto notifier = unreadStateChangeNotifier(true);
|
||||
_pinned.clear();
|
||||
_all.clear();
|
||||
_unreadState = UnreadState();
|
||||
_cloudUnreadState = UnreadState();
|
||||
|
|
Loading…
Add table
Reference in a new issue