Memory leak on tImage
Original Reporter info from Mantis: danieljabailey
-
Reporter name: Daniel J A Bailey
Original Reporter info from Mantis: danieljabailey
- Reporter name: Daniel J A Bailey
Description:
Sorry if this is in the wrong place but a simple test that creates 5000 images in an array and frees them again has shown a memory leak, you don't even need to load an image into it before freeing to see it.
Steps to reproduce:
create a simple program that executes this code... (I used lazarus to make a form with a button and onclick event)
procedure TForm1.Button1Click(Sender: TObject);
var myimages: array of timage;
i: integer;
const ArrayLength = 5000;
begin
setLength(myimages, ArrayLength);
for i := 0 to ArrayLength-1 do
begin
myimages[i] := timage.create(form1);
end;
for i := 0 to ArrayLength-1 do
begin
myimages[i].Parent := nil;
myImages[i].Free;
end;
end;
Additional information:
You can simply observe the memory use in the windows task manager, in the process tab make sure the memory column is visible, you will see it go up dramatically and then fall back down, it never goes back to where it started, every time this code runs (every time I click my button) the value goes up. (it's somewhere around 100 bytes)
Mantis conversion info:
- Mantis ID: 20111
- OS: Windows
- OS Build: 7
- Platform: i386