From 69894f3f88e7a2e2ac2e97e2a2be89479d96d4b5 Mon Sep 17 00:00:00 2001 From: Tibo Clausen Date: Wed, 15 May 2019 14:20:08 +0100 Subject: [PATCH] Remove area from LastAddedAreaCache --- src/DockContainerWidget.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/DockContainerWidget.cpp b/src/DockContainerWidget.cpp index 4985fc3..15b246d 100644 --- a/src/DockContainerWidget.cpp +++ b/src/DockContainerWidget.cpp @@ -1066,6 +1066,12 @@ void CDockContainerWidget::removeDockArea(CDockAreaWidget* area) area->setParent(nullptr); internal::hideEmptyParentSplitters(Splitter); + // Remove this area from cached areas + const auto& cache = d->LastAddedAreaCache; + if (auto p = std::find(cache, cache+sizeof(cache)/sizeof(cache[0]), area)) { + d->LastAddedAreaCache[std::distance(cache, p)] = nullptr; + } + // If splitter has more than 1 widgets, we are finished and can leave if (Splitter->count() > 1) {