diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp index 14a8bbd857d..b345356349d 100644 --- a/src/widgets/widgets/qmainwindowlayout.cpp +++ b/src/widgets/widgets/qmainwindowlayout.cpp @@ -728,6 +728,7 @@ void QDockWidgetGroupWindow::destroyIfSingleItemLeft() reparentToMainWindow(lastDockWidget); // the group window could still have placeholder items => clear everything + layoutInfo()->deleteAllLayoutItems(); layoutInfo()->item_list.clear(); // remove the group window and the dock's item_list pointing to it.