From 3c246fa49d70bfa3f1a78e97e0782d53fd2d51e6 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Tue, 15 Aug 2023 13:31:39 +0300 Subject: [PATCH] Fixed crash on destroying message view with reply ripple animation. --- Telegram/SourceFiles/history/view/history_view_message.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history/view/history_view_message.cpp b/Telegram/SourceFiles/history/view/history_view_message.cpp index b2b9fe281..a90580228 100644 --- a/Telegram/SourceFiles/history/view/history_view_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_message.cpp @@ -1791,6 +1791,7 @@ void Message::toggleReplyRipple(bool pressed) { const auto &padding = st::msgReplyPadding; const auto geometry = countGeometry(); + const auto item = data(); const auto size = QSize( geometry.width() - padding.left() / 2 @@ -1803,7 +1804,7 @@ void Message::toggleReplyRipple(bool pressed) { Images::Round( Ui::RippleAnimation::MaskByDrawer(size, true, nullptr), corners), - [=] { repaint(); }); + [=] { item->history()->owner().requestItemRepaint(item); }); } if (reply->ripple.animation) { reply->ripple.animation->add(reply->ripple.lastPoint); @@ -3814,6 +3815,7 @@ int Message::resizeContentGetHeight(int newWidth) { if (reply) { reply->resize(contentWidth - st::msgPadding.left() - st::msgPadding.right()); + reply->ripple.animation = nullptr; newHeight += st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom(); } if (needInfoDisplay()) {