From 8361f90dcecbb2eb0c754dbfc68e48d10e6ca0bf Mon Sep 17 00:00:00 2001 From: shelomentsev Date: Thu, 20 Aug 2020 15:56:37 +0500 Subject: [PATCH] Delete widgets without parents in CDockAreaLayout. (#241) --- src/DockAreaWidget.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/DockAreaWidget.cpp b/src/DockAreaWidget.cpp index 092f997..1696e1f 100644 --- a/src/DockAreaWidget.cpp +++ b/src/DockAreaWidget.cpp @@ -86,6 +86,18 @@ public: } + /** + * Delete widgets without parents in this layout + */ + ~CDockAreaLayout() + { + for(auto Widget : m_Widgets) + { + if(!Widget->parent()) + delete Widget; + } + } + /** * Returns the number of widgets in this layout */