Installer TImage.Picture TImage.SetPicture() in the ExtCtrls module, which calls TPicture.Assign() in the Graphics module, which calls TPicture.SetGraphic() , which will free the existing Graphic before assigning a new Graphic .
Thus using
Image1.Picture := nil;
Will ultimately cause
Image1.Picture.SetGraphic(nil);
And will not lead to a memory leak.
source share