locked
Memory leak with MultiScaleImage? RRS feed

  • Question

  • Hi

    I've created a Silverlight 4 application to view Photo libraries. When the user clicks on a library I fill a WrapPanel from code with a bunch of MultiScaleImages.

    When an other Library is selected I delete the existing MultiScaleImages in the wrap panel and generate the new ones for the selected library. The problem I have is that the memory increases every time when a new library is selected. The memory the old MultiScaleImages used will not be freed.

    I've tried GC.Collect after removing the MultiScaleImages from the WrapPanel with no luck.

    I've also tried to set the source for MultiScaleImage to null with no effect. Is this a bug from MultiScaleImage or what I'm doing wrong?

     

    Wednesday, February 16, 2011 7:42 PM

Answers

  • When an other Library is selected I delete the existing MultiScaleImages in the wrap panel and generate the new ones for the selected library. The problem I have is that the memory increases every time when a new library is selected. The memory the old MultiScaleImages used will not be freed.

    You problem may related with your delete action.  You'd better set to null rather than deleting it.

    Tuesday, February 22, 2011 9:40 AM