Fixed crash on destroying message view with reply ripple animation.

This commit is contained in:
23rd 2023-08-15 13:31:39 +03:00 committed by John Preston
parent 5285f74b13
commit 3c246fa49d
1 changed files with 3 additions and 1 deletions

View File

@ -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()) {