Hi.
I am using latest version of TeeChart Pro VCL (v2012.05.120327).
I encountered a memory leak when calling TeeSaveToBitmap() in unit TeeBMPOptions to save my pie chart to a bitmap file.
It seems like an object of the type TBMPOptions is not correctly freed.
Is this a known issue?
Is there a fix for this issue?
Please contact me in case you need any additional information.
Best regards!
Memory leak in TeeSaveToBitmap()
Re: Memory leak in TeeSaveToBitmap()
Hello marder,
I inform you that the last version of TeeChart Pro VCL isn't v2012.05.120327, so there do few days we published a newest version 2012.06.120613. Please, can you update your version and check if your problem persist. If your problem persist please let me know.
Thanks,
I inform you that the last version of TeeChart Pro VCL isn't v2012.05.120327, so there do few days we published a newest version 2012.06.120613. Please, can you update your version and check if your problem persist. If your problem persist please let me know.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Memory leak in TeeSaveToBitmap()
Hello Sendra,
I updated to latest version (v2012.06.120613) and the issue still persists.
The call of TeeBMPOptions.TeeSaveToBitmap() leads to a memory leak (detected by FastMM).
Best regards!
I updated to latest version (v2012.06.120613) and the issue still persists.
The call of TeeBMPOptions.TeeSaveToBitmap() leads to a memory leak (detected by FastMM).
Best regards!
Re: Memory leak in TeeSaveToBitmap()
Hi,
We've reproduced it and already fixed it for the next maintenance release.
Since you are a source code customer, here you have the changes:
At TeeBmpOptions.pas, these functions:
Are now:
And at TeeExport.pas, at the procedure TTeeExportFormat.SaveToFile, where says:
Now is:
We've reproduced it and already fixed it for the next maintenance release.
Since you are a source code customer, here you have the changes:
At TeeBmpOptions.pas, these functions:
Code: Select all
Function TBMPExportFormat.Bitmap(const AOptions:TBMPOptions):TBitmap;
begin
CheckProperties;
if Assigned(AOptions) then FProperties:=AOptions;
result:=InternalGetBitmap;
FFilters.ApplyTo(result);
end;
Code: Select all
Procedure TeeSaveToBitmap( APanel:TCustomTeePanel;
Const FileName: WideString;
Const R:TRect;
Dpi: Integer = 0);
var tmp : String;
tmpWidth,
tmpHeight : Integer;
FProperties : TBMPOptions;
begin
{ verify filename extension }
tmp:=FileName;
if ExtractFileExt(tmp)='' then
tmp:=tmp+'.bmp'; // Do not localize
FProperties:=TBMPOptions.Create(nil);
FProperties.UDDpi.Position:=Dpi;
tmpWidth:=R.Right-R.Left;
tmpHeight:=R.Bottom-R.Top;
if tmpWidth<=0 then tmpWidth:=APanel.Width;
if tmpHeight<=0 then tmpHeight:=APanel.Height;
TBMPExportFormat.SaveToFile(APanel, tmp, FProperties, tmpWidth, tmpHeight);
end;
Code: Select all
Function TBMPExportFormat.Bitmap(const AOptions:TBMPOptions):TBitmap;
begin
if Assigned(AOptions) then FProperties:=AOptions
else CheckProperties;
result:=InternalGetBitmap;
FFilters.ApplyTo(result);
if Assigned(AOptions) then
FProperties:=nil;
end;
Code: Select all
Procedure TeeSaveToBitmap( APanel:TCustomTeePanel;
Const FileName: WideString;
Const R:TRect;
Dpi: Integer = 0);
var tmp : String;
tmpWidth,
tmpHeight : Integer;
FProperties : TBMPOptions;
begin
{ verify filename extension }
tmp:=FileName;
if ExtractFileExt(tmp)='' then
tmp:=tmp+'.bmp'; // Do not localize
FProperties:=TBMPOptions.Create(nil);
try
FProperties.UDDpi.Position:=Dpi;
tmpWidth:=R.Right-R.Left;
tmpHeight:=R.Bottom-R.Top;
if tmpWidth<=0 then tmpWidth:=APanel.Width;
if tmpHeight<=0 then tmpHeight:=APanel.Height;
TBMPExportFormat.SaveToFile(APanel, tmp, FProperties, tmpWidth, tmpHeight);
finally
FProperties.Free;
end;
end;
Code: Select all
TTeeExportFormat.SaveToFile(const FileName: String;
//...
{$IFNDEF TEEOCX} // Revise for 5.04
Options;
{$ENDIF}
//...
Code: Select all
TTeeExportFormat.SaveToFile(const FileName: String;
//...
{$IFNDEF TEEOCX} // Revise for 5.04
if not Assigned(AOptions) then
Options;
{$ENDIF}
//...
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Memory leak in TeeSaveToBitmap()
Hi Yeray,
Thank you for the fast feedback and the fix!
Best Regards!
Thank you for the fast feedback and the fix!
Best Regards!