mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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());
|
cSetRecentInlineBots(RecentInlineBots());
|
||||||
cSetRecentStickers(RecentStickerPack());
|
cSetRecentStickers(RecentStickerPack());
|
||||||
HistoryView::Element::ClearGlobal();
|
HistoryView::Element::ClearGlobal();
|
||||||
|
_contactsNoChatsList.clear();
|
||||||
|
_contactsList.clear();
|
||||||
|
_chatsList.clear();
|
||||||
_histories->clearAll();
|
_histories->clearAll();
|
||||||
_webpages.clear();
|
_webpages.clear();
|
||||||
_locations.clear();
|
_locations.clear();
|
||||||
|
|
|
@ -205,6 +205,7 @@ void IndexedList::remove(Key key, Row *replacedBy) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void IndexedList::clear() {
|
void IndexedList::clear() {
|
||||||
|
_list.clear();
|
||||||
_index.clear();
|
_index.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,10 @@ public:
|
||||||
List &operator=(List &&other) = default;
|
List &operator=(List &&other) = default;
|
||||||
~List() = default;
|
~List() = default;
|
||||||
|
|
||||||
|
void clear() {
|
||||||
|
_rows.clear();
|
||||||
|
_rowByKey.clear();
|
||||||
|
}
|
||||||
[[nodiscard]] int size() const {
|
[[nodiscard]] int size() const {
|
||||||
return _rows.size();
|
return _rows.size();
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,6 +81,7 @@ void MainList::clear() {
|
||||||
recomputeFullListSize();
|
recomputeFullListSize();
|
||||||
});
|
});
|
||||||
const auto notifier = unreadStateChangeNotifier(true);
|
const auto notifier = unreadStateChangeNotifier(true);
|
||||||
|
_pinned.clear();
|
||||||
_all.clear();
|
_all.clear();
|
||||||
_unreadState = UnreadState();
|
_unreadState = UnreadState();
|
||||||
_cloudUnreadState = UnreadState();
|
_cloudUnreadState = UnreadState();
|
||||||
|
|
Loading…
Add table
Reference in a new issue