Hi, all,
I try to tile the display with album arts ( 36 albums) in zune, but after about 6 draw() iterations, the program gave me a outofmemory exception. I believe it's because of the album instances held a lot of resources(?). When is the album instance deconstructed, after each foreach iteration or after the whole foreach statement? Do I need to explicitly deconstruct it?
foreach (Album album in mediaLibrary.Albums)
{
spriteBatch.Draw(album.GetAlbumArt(Services), new Rectangle( somewhere ), Color.White);
}
Quote from xna help:
Album resources such as art and thumbnails are cached in each Album instance. Retrieving and maintaining references to multiple instances of the same album, and accessing art or thumbnails on each of those instances, creates multiple copies of the art or thumbnails. Because large numbers of album art textures can consume considerable memory, it is not advisable to hold a large number of Album objects on which GetAlbumArt has been called.