mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-01 07:05:13 +00:00
Fix possible crash in folder chats clearing.
This commit is contained in:
@@ -211,6 +211,10 @@ not_null<Dialogs::MainList*> Folder::chatsList() {
|
|||||||
return &_chatsList;
|
return &_chatsList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Folder::clearChatsList() {
|
||||||
|
_chatsList.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void Folder::chatListPreloadData() {
|
void Folder::chatListPreloadData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -35,6 +35,7 @@ public:
|
|||||||
void unregisterOne(not_null<History*> history);
|
void unregisterOne(not_null<History*> history);
|
||||||
void oneListMessageChanged(HistoryItem *from, HistoryItem *to);
|
void oneListMessageChanged(HistoryItem *from, HistoryItem *to);
|
||||||
|
|
||||||
|
void clearChatsList();
|
||||||
[[nodiscard]] not_null<Dialogs::MainList*> chatsList();
|
[[nodiscard]] not_null<Dialogs::MainList*> chatsList();
|
||||||
|
|
||||||
void applyDialog(const MTPDdialogFolder &data);
|
void applyDialog(const MTPDdialogFolder &data);
|
||||||
|
@@ -385,6 +385,9 @@ void Session::clear() {
|
|||||||
_contactsNoChatsList.clear();
|
_contactsNoChatsList.clear();
|
||||||
_contactsList.clear();
|
_contactsList.clear();
|
||||||
_chatsList.clear();
|
_chatsList.clear();
|
||||||
|
for (const auto &[id, folder] : _folders) {
|
||||||
|
folder->clearChatsList();
|
||||||
|
}
|
||||||
_histories->clearAll();
|
_histories->clearAll();
|
||||||
_webpages.clear();
|
_webpages.clear();
|
||||||
_locations.clear();
|
_locations.clear();
|
||||||
|
Reference in New Issue
Block a user