Fix crash when restoring state

- when restoring state, the old dock widgets would remove themselves
from their old dock areas and add themselves to the new dock areas. The
old dock areas that are empty would then delete themselves.
- That is a problem when the old overlay dock container would still try to
access the old dock areas, not knowing their deleted, causing a crash.
This commit is contained in:
Syarif Fakhri
2022-09-14 12:16:36 +08:00
parent 0e5329fd3e
commit ee97b03e53
3 changed files with 37 additions and 4 deletions

View File

@@ -1666,6 +1666,7 @@ void CDockContainerWidget::removeDockArea(CDockAreaWidget* area)
CDockWidget::emitTopLevelEventForWidget(TopLevelWidget, true);
dumpLayout();
d->emitDockAreasRemoved();
area->overlayDockContainer()->clearDockArea();
area->setOverlayDockContainer(nullptr);
area->updateAutoHideButtonCheckState();
area->updateTitleBarButtonToolTip();