memory leak on drawing brushes when loading it to button

Posted by Gordon999 under DotNetFunda.Com on 5/4/2013 | Points: 10 | Views : 1292 | Status : [Member] | Replies : 0
Hi there,
I have problem with memory leak when I tried to load the drawing brushes to the Button (I am using .Net 4). Basically We want to load a vector image to the button, we convert this vector image into a drawingbrush and saved it to the resourcedictionary file. And it causes memory leaks on System.Windows.Media.DrawingBrush and System.Windows.Media.RenderData, which it has system.eventhandler not released.

The code and memroy leak image are included into the attached files.

Can someone tell me what is going on and how to fix them?

Thanks a lot.



(No response found.)

Login to post response