mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Fix crash in unread bar destruction.
This commit is contained in:
parent
fe9cf7ddad
commit
fbf3168317
2 changed files with 14 additions and 5 deletions
|
@ -1014,10 +1014,10 @@ void Element::destroyUnreadBar() {
|
|||
return;
|
||||
}
|
||||
RemoveComponents(UnreadBar::Bit());
|
||||
history()->owner().requestViewResize(this);
|
||||
if (data()->mainView() == this) {
|
||||
recountAttachToPreviousInBlocks();
|
||||
}
|
||||
history()->owner().requestViewResize(this);
|
||||
}
|
||||
|
||||
int Element::displayedDateHeight() const {
|
||||
|
|
|
@ -494,6 +494,7 @@ void ListWidget::refreshRows(const Data::MessagesSlice &old) {
|
|||
) - 1;
|
||||
|
||||
auto destroyingBarElement = _bar.element;
|
||||
auto clearingOverElement = _overElement;
|
||||
_resizePending = true;
|
||||
_items.clear();
|
||||
_items.reserve(_slice.ids.size());
|
||||
|
@ -508,18 +509,26 @@ void ListWidget::refreshRows(const Data::MessagesSlice &old) {
|
|||
if (destroyingBarElement == view) {
|
||||
destroyingBarElement = nullptr;
|
||||
}
|
||||
if (clearingOverElement == view) {
|
||||
clearingOverElement = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (destroyingBarElement) {
|
||||
destroyingBarElement->destroyUnreadBar();
|
||||
_bar = {};
|
||||
}
|
||||
for (auto e = end(_items), i = e - addedToEndCount; i != e; ++i) {
|
||||
_itemRevealPending.emplace(*i);
|
||||
}
|
||||
updateAroundPositionFromNearest(nearestIndex);
|
||||
|
||||
updateItemsGeometry();
|
||||
|
||||
if (clearingOverElement) {
|
||||
_overElement = nullptr;
|
||||
}
|
||||
if (destroyingBarElement) {
|
||||
destroyingBarElement->destroyUnreadBar();
|
||||
_bar = {};
|
||||
}
|
||||
|
||||
checkUnreadBarCreation();
|
||||
restoreScrollState();
|
||||
if (!_itemsRevealHeight) {
|
||||
|
|
Loading…
Add table
Reference in a new issue