From fc4eea83f2869f4e371cb007775582a586c984b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lund=20Martsum?= Date: Wed, 6 Dec 2023 07:32:12 +0100 Subject: [PATCH] Avoid dock manager double delete (crashes) If a dockwidget has been manually deleted, the dockmanager would delete it again when deleting the area in its dtor. The 'optimal' solution would likely have been changing CDockWidget::~CDockWidget to add if (d->DockArea) d->DockArea->removeDockWidget(this); (before delete d). However, it is not trivial (for me) to conclude that such a change would be safe on program shutdown. --- src/DockAreaWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DockAreaWidget.cpp b/src/DockAreaWidget.cpp index 662aca8..bcc05aa 100644 --- a/src/DockAreaWidget.cpp +++ b/src/DockAreaWidget.cpp @@ -81,7 +81,7 @@ class CDockAreaLayout { private: QBoxLayout* m_ParentLayout; - QList m_Widgets; + QList> m_Widgets; int m_CurrentIndex = -1; QWidget* m_CurrentWidget = nullptr;