Skip to content

Commit c34d479

Browse files
tmartsumThorbjørn Lund Martsum
andauthored
Avoid dock manager double delete (crashes) (#587)
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 <thorbjorn@luxion.com>
1 parent a7a97e6 commit c34d479

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/DockAreaWidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class CDockAreaLayout
8181
{
8282
private:
8383
QBoxLayout* m_ParentLayout;
84-
QList<QWidget*> m_Widgets;
84+
QList<QPointer<QWidget>> m_Widgets;
8585
int m_CurrentIndex = -1;
8686
QWidget* m_CurrentWidget = nullptr;
8787

0 commit comments

Comments
 (0)