Memory Leak with TPNGExportFormat
Posted: Wed May 14, 2014 10:01 am
TeeChart Pro v2014.10.140220 32Bit VCL
Delphi XE5
Hi!
I am currently scanning my project for Memory Leaks with FastMM4. I have some and among those is one that's related to TPNGExportFormat. My code that produces the leak is:
The info for this in the FastMM4 report is:
Thanks a lot for your support!
Regards
Markus
Delphi XE5
Hi!
I am currently scanning my project for Memory Leaks with FastMM4. I have some and among those is one that's related to TPNGExportFormat. My code that produces the leak is:
Code: Select all
procedure SaveChartToStream;
var
tmp: TPNGExportFormat;
begin
try
tmp := TPNGExportFormat.Create;
tmp.PixelFormat := pf32bit;
tmp.Compression := 4;
tmp.Panel := MyChart;
tmp.SaveToStream(MyStream);
finally
tmp.Free;
end;
end;
I tried the above mentioned code in a seprate project and no leak occurs. So do you have any idea why the TBitmap that is created in VCLTee.TeeProcs.TCustomTeePanel.TeeCreateBitmap isn't freed?A memory block has been leaked. The size is: 68
This block was allocated by thread 0x18ED8, and the stack trace (return addresses) at the time was:
406C76 [WPRTEDefs.pas][System][@GetMem$qqri][56653]
4089F3 [WPRTEDefs.pas][System][TObject.NewInstance$qqrv][56653]
4091E2 [WPRTEDefs.pas][System][@ClassCreate$qqrpvzc][56653]
5379A6 [Vcl.Graphics][Graphics.TBitmap.$bctr$qqrv]
9F520C [VCLTee.TeeProcs][Teeprocs.TCustomTeePanel.TeeCreateBitmap$qqr21System.Uitypes.TColorrx18System.Types.TRect25Vcl.Graphics.TPixelFormati]
AA917B [VCLTee.TeePNG][Teepng.TPNGExportFormat.Bitmap$qqrv]
AA9254 [VCLTee.TeePNG][Teepng.TPNGExportFormat.SaveToStreamCompression$qqrp22System.Classes.TStreami]
5A29A3 [Vcl.ComCtrls][Comctrls.TCustomUpDown.GetPosition$qqrv]
AA92DA [VCLTee.TeePNG][Teepng.TPNGExportFormat.SaveToStream$qqrp22System.Classes.TStream]
BB8267 [RPObjectAttributes.pas][RPObjectAttributes][SaveChartToStream][2826]
BB86A2 [RPObjectAttributes.pas][RPObjectAttributes][TObjectListe.CreateInteractiveFormat$qqrp19Vcltee.Chart.TChartxixoxi][2931]
The block is currently used for an object of class: TBitmap
Thanks a lot for your support!
Regards
Markus