mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Version 1.8.4: Fix crash in local messages.
This commit is contained in:
@@ -3060,14 +3060,15 @@ void History::clear(ClearType type) {
|
||||
_loadedAtTop = _loadedAtBottom = false;
|
||||
} else {
|
||||
// Leave the 'sending' messages in local messages.
|
||||
for (auto i = begin(_localMessages); i != end(_localMessages);) {
|
||||
const auto item = *i;
|
||||
auto local = base::flat_set<not_null<HistoryItem*>>();
|
||||
for (const auto item : _localMessages) {
|
||||
if (!item->isSending()) {
|
||||
i = _localMessages.erase(i);
|
||||
} else {
|
||||
++i;
|
||||
local.emplace(item);
|
||||
}
|
||||
}
|
||||
for (const auto item : local) {
|
||||
item->destroy();
|
||||
}
|
||||
_notifications.clear();
|
||||
owner().notifyHistoryCleared(this);
|
||||
if (unreadCountKnown()) {
|
||||
|
Reference in New Issue
Block a user