From 8d9c39fa30b401cdae8174a4cf530dbef705d6d6 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Thu, 17 Dec 2020 12:00:12 +0100 Subject: [PATCH] qmldesigner: on exit crash fix Change-Id: I11d4e6b6b7bb2d8d862015718ae432b1eaaa8b57 Reviewed-by: Thomas Hartmann --- src/libs/advanceddockingsystem/dockmanager.cpp | 12 +++++++----- src/libs/advanceddockingsystem/dockmanager.h | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/libs/advanceddockingsystem/dockmanager.cpp b/src/libs/advanceddockingsystem/dockmanager.cpp index 4615df6bfeb..dd67af205a2 100644 --- a/src/libs/advanceddockingsystem/dockmanager.cpp +++ b/src/libs/advanceddockingsystem/dockmanager.cpp @@ -92,7 +92,7 @@ namespace ADS { public: DockManager *q; - QList m_floatingWidgets; + QList> m_floatingWidgets; QList m_containers; DockOverlay *m_containerOverlay = nullptr; DockOverlay *m_dockAreaOverlay = nullptr; @@ -357,9 +357,11 @@ namespace ADS save(); saveStartupWorkspace(); - for (auto floatingWidget : d->m_floatingWidgets) - delete floatingWidget; - + for (auto floatingWidget : d->m_floatingWidgets) { + if (floatingWidget) + delete floatingWidget.data(); + } + d->m_floatingWidgets.clear(); delete d; } @@ -485,7 +487,7 @@ namespace ADS return d->m_containers; } - const QList DockManager::floatingWidgets() const + const QList> DockManager::floatingWidgets() const { return d->m_floatingWidgets; } diff --git a/src/libs/advanceddockingsystem/dockmanager.h b/src/libs/advanceddockingsystem/dockmanager.h index 43ba751e48b..174239e22a7 100644 --- a/src/libs/advanceddockingsystem/dockmanager.h +++ b/src/libs/advanceddockingsystem/dockmanager.h @@ -389,7 +389,7 @@ public: /** * Returns the list of all floating widgets. */ - const QList floatingWidgets() const; + const QList > floatingWidgets() const; /** * This function always return 0 because the main window is always behind