From 22aef5290f110efcf0b37533890316b2d024e9ad Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 10 Dec 2015 17:33:59 +0300 Subject: [PATCH] fixed crash in groups uniting --- Telegram/SourceFiles/history.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 28854b397..2504c9c45 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -1987,12 +1987,7 @@ void History::addOlderSlice(const QVector &slice, const QVectortype() == HistoryItemGroup && prev->type() == HistoryItemGroup) { static_cast(prev)->uniteWith(static_cast(till)); - till->detach(); - delete till; - if (blocks.front()->items.isEmpty()) { - delete blocks.front(); - blocks.pop_front(); - } + till->destroy(); till = blocks.isEmpty() ? 0 : blocks.front()->items.front(); } if (till && prev && prev->date.date() != till->date.date()) {