mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix rare crash in message history resizing.
This commit is contained in:
parent
a064e836f2
commit
5aff4cca0e
1 changed files with 12 additions and 0 deletions
|
@ -5018,6 +5018,8 @@ void HistoryWidget::startItemRevealAnimations() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::updateListSize() {
|
void HistoryWidget::updateListSize() {
|
||||||
|
Expects(_list != nullptr);
|
||||||
|
|
||||||
_list->recountHistoryGeometry();
|
_list->recountHistoryGeometry();
|
||||||
auto washidden = _scroll->isHidden();
|
auto washidden = _scroll->isHidden();
|
||||||
if (washidden) {
|
if (washidden) {
|
||||||
|
@ -5033,6 +5035,16 @@ void HistoryWidget::updateListSize() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HistoryWidget::hasPendingResizedItems() const {
|
bool HistoryWidget::hasPendingResizedItems() const {
|
||||||
|
if (!_list) {
|
||||||
|
// Based on the crash reports there is a codepath (at least on macOS)
|
||||||
|
// that leads from _list = _scroll->setOwnedWidget(...) right into
|
||||||
|
// the HistoryWidget::paintEvent (by sending fake mouse move events
|
||||||
|
// inside scroll area -> hiding tooltip window -> exposing the main
|
||||||
|
// window -> syncing it backing store synchronously).
|
||||||
|
//
|
||||||
|
// So really we could get here with !_list && (_history != nullptr).
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return (_history && _history->hasPendingResizedItems())
|
return (_history && _history->hasPendingResizedItems())
|
||||||
|| (_migrated && _migrated->hasPendingResizedItems());
|
|| (_migrated && _migrated->hasPendingResizedItems());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue