mirror of
https://github.com/vale981/tdesktop
synced 2025-03-06 02:01:40 -05:00
Fix possible crash in HistoryWidget.
Stack in crash reports leads to something like that: - HistoryWidget::showHistory - _scroll->setOwnedWidget - Ui::ScrollArea::onScrolled - sendSynteticMouseEvent - Info::Media::ListWidget::enterEventHook - Info::Media::ListWidget::mouseAction?Update - Overview::Layout::ItemBase::clickHandlerActiveChanged - AuthSessionData::requestItemRepaint - HistoryWidget::repaintHistoryItem Workaround: - Don't accept repaint item requests while _list is not set yet.
This commit is contained in:
parent
6295d85ef2
commit
aef88559e8
1 changed files with 9 additions and 0 deletions
|
@ -4657,6 +4657,15 @@ void HistoryWidget::grabFinish() {
|
|||
|
||||
void HistoryWidget::repaintHistoryItem(
|
||||
not_null<const HistoryItem*> item) {
|
||||
// It is possible that repaintHistoryItem() will be called from
|
||||
// _scroll->setOwnedWidget() because it calls onScroll() that
|
||||
// sendSynteticMouseEvent() and it could lead to some Info layout
|
||||
// calling Auth().data().requestItemRepaint(), while we still are
|
||||
// in progrss of showing the history. Just ignore them for now :/
|
||||
if (!_list) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto itemHistory = item->history();
|
||||
if (itemHistory == _history || itemHistory == _migrated) {
|
||||
auto ms = getms();
|
||||
|
|
Loading…
Add table
Reference in a new issue