Fix crash when restoring state but better

- Rather than having to check for nullptr, just make sure the slot isn't
called
This commit is contained in:
Syarif Fakhri 2022-09-14 12:34:13 +08:00
parent 6b85b2b505
commit 773f186a7f

View File

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