Home

WPF memory leak on control close via ToolStrip

Throwing this out there to hopefully get it fixed, or if someone already has a work around.

With the following code:
void Main()
{
var wpfElement = new Label()
{
Content = "Test"
};
var panel = PanelManager.DisplayWpfElement(wpfElement,"Test");
}

I get 5Mb of memory not being freed every time this is run followed by closing the visualiser . My guess is that the ElementHost is not being disposed properly. This is backed up by the following

void Main()
{
for (int i = 0; i < 10000; i++)
{
var wpfElement = new Label()
{
Content = "Test"
};
var panel = PanelManager.DisplayWpfElement(wpfElement,"Test");
panel.Close();
}
}

Having no overhead when garbage collected

Thanks

Comments

Sign In or Register to comment.