I have read here http://delphi.about.com/od/adptips2005/qt/cleartimage.htm that a way to clear an image from a TImage is to assign nil to .Picture
, like this:
Image1.Picture := nil;
I just want to be sure... I guess the Image1.Picture.loadFromFile(fileName)
will allocate some memory and simply setting it to nil, without freeing the memory, will lead to a memory leak.
Am I correct? If this is so, which is the "proper" way to unload and clear an image from a TImage?