TeeSaveToJPEGFile produces memory leak

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
marder
Advanced
Posts: 115
Joined: Thu May 29, 2008 12:00 am

TeeSaveToJPEGFile produces memory leak

Post by marder » Fri Mar 01, 2013 8:31 am

Hi.

I am using the latest version of TeeChart Pro (2012.07.121105) with Delphi XE2 (Update 4).

When I close my application after saving my chart to a JPG image using the method TeeSaveToJPEGFile() from unit "Teejpeg" I got this memory leak reported:
Image

Note: In the Delphi Application you have to set ReportMemoryLeaksOnShutDown := True; to get this kind of memory leak report.

Is this a known issue?
Could you provide a fix for this?

Please let me know if you need any further information or a simple sample project to reproduce.
Best regrads.

Yeray
Site Admin
Site Admin
Posts: 8853
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TeeSaveToJPEGFile produces memory leak

Post by Yeray » Fri Mar 01, 2013 10:39 am

Hi marder,

I can reproduce it with v2012.07 but not with the actual sources we have here.
I think it was fixed when changing, in TeeJPEG.pas:

Code: Select all

Function TJPEGExportFormat.Jpeg(const AOptions:TTeeJPEGOptions):TJPEGImage;
var Params : TJPEGDefaults;
begin
  { returns a JPEG image using the "Panel" (Chart) property }
  if not Assigned(Panel) then
     Raise Exception.Create(TeeMsg_ExportPanelNotSet);

  CheckProperties;

  { set JPEG options }
  Params:=JPEGDefaults;

  if Assigned(AOptions) then FProperties:=AOptions;

  Params.GrayScale:=FProperties.CBGray.Checked;
  Params.CompressionQuality:=FProperties.UpDown1.Position;
  Params.Performance:=TJPEGPerformance(FProperties.RGPerf.ItemIndex);

  CheckSize;

  { obtain a JPEG image using parameters }
  result:=TeeGetJPEGImageParams(Panel,Params,0,0,Width,Height);
end;
For this:

Code: Select all

Function TJPEGExportFormat.Jpeg(const AOptions:TTeeJPEGOptions):TJPEGImage;
var Params : TJPEGDefaults;
begin
  { returns a JPEG image using the "Panel" (Chart) property }
  if not Assigned(Panel) then
     Raise Exception.Create(TeeMsg_ExportPanelNotSet);

  if Assigned(AOptions) then FProperties:=AOptions
                        else CheckProperties;

  { set JPEG options }
  Params:=JPEGDefaults;

  Params.GrayScale:=FProperties.CBGray.Checked;
  Params.CompressionQuality:=FProperties.UpDown1.Position;
  Params.Performance:=TJPEGPerformance(FProperties.RGPerf.ItemIndex);

  CheckSize;

  { obtain a JPEG image using parameters }
  result:=TeeGetJPEGImageParams(Panel,Params,0,0,Width,Height);
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

marder
Advanced
Posts: 115
Joined: Thu May 29, 2008 12:00 am

Re: TeeSaveToJPEGFile produces memory leak

Post by marder » Fri Mar 01, 2013 11:47 am

Ok.
Could you confirm that this new code will make it to the next official release of TeeChart Pro?
In this case this will be good enougth for us.

Thanks and best regards.

Yeray
Site Admin
Site Admin
Posts: 8853
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TeeSaveToJPEGFile produces memory leak

Post by Yeray » Fri Mar 01, 2013 1:11 pm

Hi,

Yes, being in the actual sources we have here means it would be in a release if we prepared one. And I see no reason why anyone would revert this change.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply