qmldesigner: on exit crash fix

Change-Id: I11d4e6b6b7bb2d8d862015718ae432b1eaaa8b57
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Tim Jenssen
2020-12-17 12:00:12 +01:00
parent c723db7129
commit 8d9c39fa30
2 changed files with 8 additions and 6 deletions

View File

@@ -92,7 +92,7 @@ namespace ADS
{ {
public: public:
DockManager *q; DockManager *q;
QList<FloatingDockContainer *> m_floatingWidgets; QList<QPointer<FloatingDockContainer>> m_floatingWidgets;
QList<DockContainerWidget *> m_containers; QList<DockContainerWidget *> m_containers;
DockOverlay *m_containerOverlay = nullptr; DockOverlay *m_containerOverlay = nullptr;
DockOverlay *m_dockAreaOverlay = nullptr; DockOverlay *m_dockAreaOverlay = nullptr;
@@ -357,9 +357,11 @@ namespace ADS
save(); save();
saveStartupWorkspace(); saveStartupWorkspace();
for (auto floatingWidget : d->m_floatingWidgets) for (auto floatingWidget : d->m_floatingWidgets) {
delete floatingWidget; if (floatingWidget)
delete floatingWidget.data();
}
d->m_floatingWidgets.clear();
delete d; delete d;
} }
@@ -485,7 +487,7 @@ namespace ADS
return d->m_containers; return d->m_containers;
} }
const QList<FloatingDockContainer *> DockManager::floatingWidgets() const const QList<QPointer<FloatingDockContainer>> DockManager::floatingWidgets() const
{ {
return d->m_floatingWidgets; return d->m_floatingWidgets;
} }

View File

@@ -389,7 +389,7 @@ public:
/** /**
* Returns the list of all floating widgets. * Returns the list of all floating widgets.
*/ */
const QList<FloatingDockContainer *> floatingWidgets() const; const QList<QPointer<FloatingDockContainer> > floatingWidgets() const;
/** /**
* This function always return 0 because the main window is always behind * This function always return 0 because the main window is always behind