Skip to content

Conversation

@tmartsum
Copy link

@tmartsum tmartsum commented Dec 6, 2023

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.

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.
@githubuser0xFFFF
Copy link
Owner

Thank you.

@githubuser0xFFFF githubuser0xFFFF merged commit c34d479 into githubuser0xFFFF:master Dec 6, 2023
@tmartsum tmartsum deleted the bugfix/avoid_dockmgr_delete_of_deleted_objects branch December 7, 2023 06:37
mike-malburg pushed a commit to TechSmith/Qt-Advanced-Docking-System that referenced this pull request Nov 6, 2025
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants