From c34d479d5ca812b8436498ebd190b5f13c77b5fa Mon Sep 17 00:00:00 2001 From: tmartsum Date: Wed, 6 Dec 2023 15:12:48 +0100 Subject: [PATCH] Avoid dock manager double delete (crashes) (#587) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Co-authored-by: Thorbjørn Lund Martsum --- 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;