views:

175

answers:

0

I'm using ImageBrush as a background of InkCanvas. I have to dispose the ImageBrush when deleting but the memory still raise up until the program throws an Exception (Out of Memory).

I did use freeze Method and making the ImageBrush = null and giving it Empty Source but the memory still raising up.

Have you found any solution to dispose ImageBrush?

My Code:

ImageBrush imb = MainCanvas.Background as ImageBrush;

imb.Freeze();

imb = null;

MainCanvas.Background = null;

GC.Collect();