Hi,
I use last version of ImageEN and doing the resample of an image I noticed a small memory leak.
In the AssignEx method, a TBitmap is created when a Graphics or Picture object is loaded into a TIEBitmap and it's no longer released.
From row 24164:
if ( Source is TGraphic ) or ( Source is TPicture ) then
begin
bmp := TBitmap.Create;
if Source is TPicture then
bmp.assign( TPicture( Source ).Graphic )
else
bmp.assign( TGraphic( Source ));
CopyFromTBitmap( bmp );
if bmp.PixelFormat = pf32bit then
SynchronizeRGBA(True, True);
end
bmp is no longer released.
I changed the code like this:
if ( Source is TGraphic ) or ( Source is TPicture ) then
begin
bmp := TBitmap.Create;
try <--added
if Source is TPicture then
bmp.assign( TPicture( Source ).Graphic )
else
bmp.assign( TGraphic( Source ));
CopyFromTBitmap( bmp );
if bmp.PixelFormat = pf32bit then
SynchronizeRGBA(True, True);
finally <--added
bmp.free; <--added
end; <--added
end
Now work fine without more memory leaks.
Best regards
Claudio Piffer