This project is read-only.

Memory leak in Animated image


On Windows Phone 7, I noticed the animatedimage control was not getting unloaded due to the timer not being stopped (forcing the control to stay in memory).
In the constructor add..
        this.Unloaded += new RoutedEventHandler(AnimatedImage_Unloaded);
    void AnimatedImage_Unloaded(object sender, RoutedEventArgs e)
That will stop the timer and force the control to be unloaded when it is no longer in use.


zaxbowow wrote Sep 30, 2012 at 9:48 PM

This was a big clue to solving my issue, thanks.

For an ExtendedImage using the GifDecoder, be VERY SURE to call <ThisImage>.Stop in the navigation event leaving the page on which it is placed. Otherwise "Out of Memory" errors can/will occur on subsequent visits to that page.

wrote Feb 22, 2013 at 12:53 AM

wrote Jun 8, 2015 at 12:22 PM