mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-01-24 05:22:06 +08:00
Fix Undefined Behavior in LastAddedAreaCache (#211)
This commit is contained in:
parent
da20405a6a
commit
0225563b46
@ -1319,9 +1319,9 @@ void CDockContainerWidget::removeDockArea(CDockAreaWidget* area)
|
|||||||
internal::hideEmptyParentSplitters(Splitter);
|
internal::hideEmptyParentSplitters(Splitter);
|
||||||
|
|
||||||
// Remove this area from cached areas
|
// Remove this area from cached areas
|
||||||
const auto& cache = d->LastAddedAreaCache;
|
auto p = std::find(std::begin(d->LastAddedAreaCache), std::end(d->LastAddedAreaCache), area);
|
||||||
if (auto p = std::find(cache, cache+sizeof(cache)/sizeof(cache[0]), area)) {
|
if (p != std::end(d->LastAddedAreaCache)) {
|
||||||
d->LastAddedAreaCache[std::distance(cache, p)] = nullptr;
|
*p = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If splitter has more than 1 widgets, we are finished and can leave
|
// If splitter has more than 1 widgets, we are finished and can leave
|
||||||
|
Loading…
Reference in New Issue
Block a user