Fix potential crash at shutdown

QWidget DTOR can trigger a focus change, which triggers
DockRegistry::onFocusObjectChanged(), which would dereference the
dockwidget
This commit is contained in:
Sergio Martins
2020-09-24 16:05:38 +01:00
parent c7e9632f18
commit a00984f95a

View File

@@ -260,6 +260,9 @@ void DockRegistry::registerDockWidget(DockWidgetBase *dock)
void DockRegistry::unregisterDockWidget(DockWidgetBase *dock)
{
if (m_focusedDockWidget == dock)
m_focusedDockWidget = nullptr;
m_dockWidgets.removeOne(dock);
maybeDelete();
}