Fix crash in auto hide tab (#552)

- Crash is caused by dragging an autohide tab out when it is an icon only.
- The crash can actually happen with non icon only tabs, but is masked by the orientation check.
- Soln: Check if auto hide container exists first on mouse finish dragging event.
This commit is contained in:
Ahmad Syarifuddin 2023-08-24 17:15:43 +08:00 committed by GitHub
parent 2d2de53dcd
commit 61573cba16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -478,7 +478,7 @@ void CAutoHideTab::mouseReleaseEvent(QMouseEvent* ev)
case DraggingFloatingWidget:
ev->accept();
d->FloatingWidget->finishDragging();
if (d->DockWidget->isAutoHide() && d->DragStartOrientation != orientation())
if (d->DockWidget->autoHideDockContainer() && d->DragStartOrientation != orientation())
{
d->DockWidget->autoHideDockContainer()->resetToInitialDockWidgetSize();
}