Image
also implements IDisposable
, therefore wrap in using
:
using (Image background = downloadBackground(URL + getResolutionExtension()))
{
saveBackground(background);
setBackground(background, PicturePosition.Fill);
}
Ok, more info: Image
may utilize a sizable amount of memory, depending on the image, so executing deterministic disposal of those resources is incumbent upon the developer in order to ensure best application behavior. Read here for additional information.