mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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;
|
return;
|
||||||
}
|
}
|
||||||
RemoveComponents(UnreadBar::Bit());
|
RemoveComponents(UnreadBar::Bit());
|
||||||
history()->owner().requestViewResize(this);
|
|
||||||
if (data()->mainView() == this) {
|
if (data()->mainView() == this) {
|
||||||
recountAttachToPreviousInBlocks();
|
recountAttachToPreviousInBlocks();
|
||||||
}
|
}
|
||||||
|
history()->owner().requestViewResize(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Element::displayedDateHeight() const {
|
int Element::displayedDateHeight() const {
|
||||||
|
|
|
@ -494,6 +494,7 @@ void ListWidget::refreshRows(const Data::MessagesSlice &old) {
|
||||||
) - 1;
|
) - 1;
|
||||||
|
|
||||||
auto destroyingBarElement = _bar.element;
|
auto destroyingBarElement = _bar.element;
|
||||||
|
auto clearingOverElement = _overElement;
|
||||||
_resizePending = true;
|
_resizePending = true;
|
||||||
_items.clear();
|
_items.clear();
|
||||||
_items.reserve(_slice.ids.size());
|
_items.reserve(_slice.ids.size());
|
||||||
|
@ -508,18 +509,26 @@ void ListWidget::refreshRows(const Data::MessagesSlice &old) {
|
||||||
if (destroyingBarElement == view) {
|
if (destroyingBarElement == view) {
|
||||||
destroyingBarElement = nullptr;
|
destroyingBarElement = nullptr;
|
||||||
}
|
}
|
||||||
|
if (clearingOverElement == view) {
|
||||||
|
clearingOverElement = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (destroyingBarElement) {
|
|
||||||
destroyingBarElement->destroyUnreadBar();
|
|
||||||
_bar = {};
|
|
||||||
}
|
|
||||||
for (auto e = end(_items), i = e - addedToEndCount; i != e; ++i) {
|
for (auto e = end(_items), i = e - addedToEndCount; i != e; ++i) {
|
||||||
_itemRevealPending.emplace(*i);
|
_itemRevealPending.emplace(*i);
|
||||||
}
|
}
|
||||||
updateAroundPositionFromNearest(nearestIndex);
|
updateAroundPositionFromNearest(nearestIndex);
|
||||||
|
|
||||||
updateItemsGeometry();
|
updateItemsGeometry();
|
||||||
|
|
||||||
|
if (clearingOverElement) {
|
||||||
|
_overElement = nullptr;
|
||||||
|
}
|
||||||
|
if (destroyingBarElement) {
|
||||||
|
destroyingBarElement->destroyUnreadBar();
|
||||||
|
_bar = {};
|
||||||
|
}
|
||||||
|
|
||||||
checkUnreadBarCreation();
|
checkUnreadBarCreation();
|
||||||
restoreScrollState();
|
restoreScrollState();
|
||||||
if (!_itemsRevealHeight) {
|
if (!_itemsRevealHeight) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue