diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp index b81b17a64ba..869fc49c021 100644 --- a/src/widgets/widgets/qmainwindowlayout.cpp +++ b/src/widgets/widgets/qmainwindowlayout.cpp @@ -732,6 +732,7 @@ void QDockWidgetGroupWindow::destroyIfSingleItemLeft() reparentToMainWindow(lastDockWidget); // the group window could still have placeholder items => clear everything + layoutInfo()->deleteAllLayoutItems(); layoutInfo()->item_list.clear(); destroyOrHideIfEmpty();