From 8f4fdb6d0d6c135c21bc806a89e74a1a89a9f0ba Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 25 Sep 2020 20:22:43 +0300 Subject: [PATCH] Fix crash in mark folder as read. --- Telegram/SourceFiles/window/window_peer_menu.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/window/window_peer_menu.cpp b/Telegram/SourceFiles/window/window_peer_menu.cpp index db943a372b..688544cf42 100644 --- a/Telegram/SourceFiles/window/window_peer_menu.cpp +++ b/Telegram/SourceFiles/window/window_peer_menu.cpp @@ -85,11 +85,13 @@ void MarkAsReadHistory(not_null history) { } void MarkAsReadChatList(not_null list) { + auto mark = std::vector>(); for (const auto &row : list->indexed()->all()) { if (const auto history = row->history()) { - MarkAsReadHistory(history); + mark.push_back(history); } } + ranges::for_each(mark, MarkAsReadHistory); } class Filler {