WpfDesigner
WpfDesigner copied to clipboard
Memory Leak in PropertyGrid when Rearranging Controls
Hello, I think I found a memory leak. Here are the steps to reproduce it on Demo.XamlDesigner:
- run Demo.XamlDesigner app
- in the XAML tab, paste the following code:
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="640"
Height="480">
<Canvas>
<TabControl Width="304"
Height="167"
Canvas.Left="72"
Canvas.Top="132">
<TabItem />
<TabItem />
<TabItem />
<TabItem />
<CheckBox />
</TabControl>
<CheckBox Canvas.Left="157" Canvas.Top="233.04000000000002" />
<CheckBox Canvas.Left="242" Canvas.Top="208" />
<CheckBox Canvas.Left="157" Canvas.Top="173.04000000000002" />
<CheckBox Canvas.Left="234" Canvas.Top="158" />
<CheckBox Canvas.Left="116" Canvas.Top="208" />
</Canvas>
</Window>
- switch to Design view
- in the outline panel, drag and drop the tab items and check boxes onto each other randomly
- see the process memory consumption increase
Here is the screen recording video of this process.
If you comment out the PropertyGrid.Reload method body, the problem seems to disappear. This this might be PropertyNode - related. However, I was unable to track down the object retention problem to fix it.