I think you'll find the bug is most likely still there, just covered up with the difference of code generation that
takes place with the option you selected, but then again I could be wrong.....
Recently just prior to 2.0.2 release I found a bug and others helped to locate it and come up a plan to fix it..
The bug is in the TRawImage.LoadFromRawImage call, it actually recreates more chucks of memory when copying the
image and not freeing the original..
Maybe what you are seeing is something in that component getting effective by it?
Put this in the interface section
and this in the
TBitmap = Class(Graphics.TBitmap)
procedure LoadFromRawImage(const AImage: TRawImage; ADataOwner: Boolean);
end;
implementation sectect.
procedure TBitmap.LoadFromRawImage(const AImage: TRawImage; ADataOwner: Boolean);
var
img: PRawImage;
begin
BeginUpdate;
try
Clear;
if AImage.Description.Format = ricfNone then Exit; // empty image
img := GetRawImagePtr;
img^.Description := AImage.Description;
if ADataOwner
then begin
img^.DataSize := AImage.DataSize;
img^.Data := AImage.Data;
img^.MaskSize := AImage.MaskSize;
img^.Mask := AImage.Mask;
img^.PaletteSize := AImage.PaletteSize;
img^.Palette := AImage.Palette;
end
else begin
// copy needed
img^.DataSize := AImage.DataSize;
if img^.DataSize > 0
then begin
//GetMem(img^.Data, img^.DataSize);
ReallocMem(img^.Data, img^.DataSize);
Move(AImage.Data^, img^.Data^, img^.DataSize);
end
else img^.Data := nil;
img^.MaskSize := AImage.MaskSize;
if img^.MaskSize > 0
then begin
//GetMem(img^.Mask, img^.MaskSize);
Reallocmem(img^.Mask, img^.MaskSize);
Move(AImage.Mask^, img^.Mask^, img^.MaskSize);
end
else img^.Mask := nil;
img^.PaletteSize := AImage.PaletteSize;
if img^.PaletteSize > 0
then begin
// GetMem(img^.Palette, img^.PaletteSize);
ReallocMem(img^.Palette, img^.PaletteSize);
Move(AImage.Palette^, img^.Palette^, img^.PaletteSize);
end
else img^.Palette := nil;
end;
finally
EndUpdate;
end;
I put that in the unit where I was using RawImages.LoadfromRawImage and it fixed the leak
the commented lines are the original, the allocatmem is the added lines.
P.S.
I guess I didn't submit soon enough, this bug is still in 2.0.2