From 12dfc8d5ed4756f15a9ce5252af80d3daa9fa074 Mon Sep 17 00:00:00 2001 From: Axel Spoerl Date: Mon, 7 Apr 2025 13:52:47 +0200 Subject: [PATCH] QDockWidgetGroupWindow: Properly destroy gap items and separators QDockWidgetGroupWindow::destroyIfSingleItemLeft() cleared the item list without checking for gap or separator items. When a QDockWidget was deleted during an active drag, these items were leaked. Call deleteAllLayoutItems() before clearing the item list. Amends e6d85cf28bc4f750b69c33b72c006b067ae1190f. Task-number: QTBUG-135442 Pick-to: 6.9 6.8 6.5 Change-Id: I94dffe162023c12bda1f801236ae4462229601b5 Reviewed-by: Richard Moe Gustavsen Reviewed-by: Marc Mutz --- src/widgets/widgets/qmainwindowlayout.cpp | 1 + 1 file changed, 1 insertion(+) 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.