From b7431a378fa2578ce9f0b779fb3fae4e78a32aef Mon Sep 17 00:00:00 2001 From: frsa Date: Sun, 27 Aug 2023 20:23:55 +0200 Subject: [PATCH] Removed the invalid check for non-floating content before clearing the PreviousContainer during LayoutRoot.CollectGarbage. --- source/Components/AvalonDock/Layout/LayoutRoot.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Components/AvalonDock/Layout/LayoutRoot.cs b/source/Components/AvalonDock/Layout/LayoutRoot.cs index 957b8a8f..314ae015 100644 --- a/source/Components/AvalonDock/Layout/LayoutRoot.cs +++ b/source/Components/AvalonDock/Layout/LayoutRoot.cs @@ -383,9 +383,9 @@ public void CollectGarbage() //for each pane that is empty foreach (var emptyPane in this.Descendents().OfType().Where(p => p.ChildrenCount == 0)) { - //...set null any reference coming from contents not yet hosted in a floating window + //...set null any reference coming from contents foreach (var contentReferencingEmptyPane in this.Descendents().OfType() - .Where(c => ((ILayoutPreviousContainer)c).PreviousContainer == emptyPane && !c.IsFloating)) + .Where(c => ((ILayoutPreviousContainer)c).PreviousContainer == emptyPane)) { if (contentReferencingEmptyPane is LayoutAnchorable anchorable && !anchorable.IsVisible)