Remove old crash fix

This commit is contained in:
Syarif Fakhri 2022-09-14 13:10:06 +08:00
parent 8e5e974669
commit f3305b95d2
2 changed files with 5 additions and 5 deletions

View File

@ -515,7 +515,7 @@ void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget)
{
setCurrentDockWidget(NextOpenDockWidget);
}
else if (d->ContentsLayout->isEmpty() && DockContainer->dockAreaCount() >= 1)
else if (d->ContentsLayout->isEmpty() && DockContainer->dockAreaCount() >= 1 && !isOverlayed()) // Don't remove empty dock areas that are overlayed, they'll be deleted by the overlay dock
{
ADS_PRINT("Dock Area empty");
DockContainer->removeDockArea(this);

View File

@ -196,6 +196,10 @@ COverlayDockContainer::~COverlayDockContainer()
{
ADS_PRINT("~COverlayDockContainer");
// Remove event filter in case there are any queued messages
d->DockArea->removeEventFilter(this);
parent()->removeEventFilter(this);
if (d->DockManager)
{
parentContainer()->removeOverlayWidget(this);
@ -310,10 +314,6 @@ void COverlayDockContainer::cleanupAndDelete()
dockWidget->sideTabWidget()->hide();
}
// Remove event filter in case there are any queued messages
d->DockArea->removeEventFilter(this);
parent()->removeEventFilter(this);
hide();
deleteLater();
}