When a DockWidget is closed, Frame::scheduleDeleteLater gets called, which doesn't immediately delete the Frame. If the DockWidget is shown again before ~Frame has had a chance to run, the DockWidget will become a parent of the Frame again and will be destroyed when Frame gets deleted.
Fix this by doing the necessary housekeeping when the Frame is scheduled for deletion.
When a DockWidget is closed, Frame::scheduleDeleteLater gets called, which doesn't immediately delete the Frame. If the DockWidget is shown again before ~Frame has had a chance to run, the DockWidget will become a parent of the Frame again and will be destroyed when Frame gets deleted.
Fix this by doing the necessary housekeeping when the Frame is scheduled for deletion.