Fix possible crash in fast action in chats list.

This commit is contained in:
John Preston
2025-10-01 13:00:24 +04:00
parent c73788da24
commit 1efa889913

View File

@@ -1978,11 +1978,14 @@ void InnerWidget::mousePressEvent(QMouseEvent *e) {
});
} else if (_pressed) {
auto row = _pressed;
const auto weak = base::make_weak(this);
const auto updateCallback = [weak, row] {
const auto strong = weak.get();
if (!strong || !strong->_pinnedShiftAnimation.animating()) {
row->entry()->updateChatListEntry();
const auto weakThis = base::make_weak(this);
const auto weakEntry = base::make_weak(row->entry());
const auto updateCallback = [weakThis, weakEntry] {
const auto that = weakThis.get();
if (!that || !that->_pinnedShiftAnimation.animating()) {
if (const auto entry = weakEntry.get()) {
entry->updateChatListEntry();
}
}
};
const auto origin = e->pos()