[Version 2: Commit 94905] LayoutAnchorable Memory Leak (LayoutRoot)
description
If you progmatically add a LayoutAnchorable to a LayoutAnchorablePane then close the LayoutAnchorable, the anchorable sticks around in the LayoutRoot. If you do this repeatedly, many objects build up rapidly.
Step 1) Add an anchorable to your pane:
LayoutDocumentPane pane = layoutRoot.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(p => p.Name == "myAnchorablePane");
pane.Children.Add(new LayoutAnchorable());
Step 2) Close the window that showed up in the UI.
Step 3) Repeat several times.
Step 4) Check the ChildrenCount of your LayoutRoot. It is higher than expected. Evaluate the Children of the LayoutRoot. There are a bunch of LayoutAnchorables that you never put there yourself.