From 736c096bc008716fd0e413727f4d5fbec7a08408 Mon Sep 17 00:00:00 2001 From: Syarif Fakhri Date: Thu, 3 Nov 2022 11:50:41 +0800 Subject: [PATCH] make a copy before deleting --- src/DockContainerWidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/DockContainerWidget.cpp b/src/DockContainerWidget.cpp index 459b166..91316cb 100644 --- a/src/DockContainerWidget.cpp +++ b/src/DockContainerWidget.cpp @@ -1532,7 +1532,8 @@ bool CDockContainerWidget::event(QEvent *e) //============================================================================ void CDockContainerWidget::deleteAutoHideWidgets() { - for (auto AutohideWidget : d->AutoHideWidgets) + const auto autoHideWidgets = d->AutoHideWidgets; + for (auto AutohideWidget : autoHideWidgets) { AutohideWidget->cleanupAndDelete(); }