Fixed crash when trying to update selected state in

HistoryInner while _history/_migrated had pending resize items.
This commit is contained in:
John Preston 2016-03-29 20:48:54 +03:00
parent 9378c05ef1
commit 532e7e7e81
1 changed files with 14 additions and 2 deletions

View File

@ -197,6 +197,16 @@ void HistoryInner::paintEvent(QPaintEvent *e) {
if (!App::main()) return;
if ((_history && _history->hasPendingResizedItems()) || (_migrated && _migrated->hasPendingResizedItems())) {
Notify::handlePendingHistoryUpdate();
if (_history) {
t_assert(!_history->hasPendingResizedItems());
}
if (_migrated) {
t_assert(!_migrated->hasPendingResizedItems());
}
}
Painter p(this);
QRect r(e->rect());
bool trivial = (rect() == r);
@ -1677,7 +1687,9 @@ void HistoryInner::onTouchSelect() {
}
void HistoryInner::onUpdateSelected() {
if (!_history) return;
if (!_history || _history->hasPendingResizedItems() || (_migrated && _migrated->hasPendingResizedItems())) {
return;
}
QPoint mousePos(mapFromGlobal(_dragPos));
QPoint point(_widget->clampMousePosition(mousePos));
@ -6286,7 +6298,7 @@ void HistoryWidget::notify_automaticLoadSettingsChangedGif() {
}
void HistoryWidget::notify_handlePendingHistoryUpdate() {
if (_history && _history->hasPendingResizedItems()) {
if ((_history && _history->hasPendingResizedItems()) || (_migrated && _migrated->hasPendingResizedItems())) {
updateListSize();
_list->update();
}