QTabBar: Fix crash when the tab being dragged is deleted programmatically.
Call QTabBarPrivate::moveTabFinished() from QTabBar::removeTab() to cancel any drag in progress to prevent crashes due to invalidated indexes. Task-number: QTBUG-52527 Change-Id: I5bd8cc6f55e5aea1f1a4710494ba5b92939a42ee Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>bb10
parent
cc7cd61909
commit
5fb2dceab4
|
|
@ -897,6 +897,9 @@ void QTabBar::removeTab(int index)
|
|||
{
|
||||
Q_D(QTabBar);
|
||||
if (d->validIndex(index)) {
|
||||
if (d->dragInProgress)
|
||||
d->moveTabFinished(d->pressedIndex);
|
||||
|
||||
#ifndef QT_NO_SHORTCUT
|
||||
releaseShortcut(d->tabList.at(index).shortcutId);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue