Memory leak when using TTeeGDIPlus

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Kubach
Newbie
Newbie
Posts: 6
Joined: Tue May 11, 2010 12:00 am

Memory leak when using TTeeGDIPlus

Post by Kubach » Thu Jun 10, 2010 9:38 am

Hi,

it seems there is a memory leak when using TTeeGDIPlus. It can be reproduced in the sample project (Delphi 2010) I've attached.
Just run the code and then resize the form a couple of times and then close it. I've also attached a screenshot of the FastMM report that pops up.

I think it's caused by TGDIPlusCanvas.InitWindow() which is called by the draw routine.

It creates a TTeeCanvas3D object each time it is called but doesn't free it
...
begin
IXORCanvas:=TTeeCanvas3D.Create;

Could you please take a look at it?

Regards,
Amadeus
Attachments
GDIPlusMemLeak.7z
(28.35 KiB) Downloaded 238 times

Kubach
Newbie
Newbie
Posts: 6
Joined: Tue May 11, 2010 12:00 am

Re: Memory leak when using TTeeGDIPlus

Post by Kubach » Thu Jun 10, 2010 12:02 pm

While I'm at it: seems there's another one in Chart.pas ->TLegendSymbol.Draw()

OldBrush:=TBrush.Create;

OldBrush doesn't get freed.

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

Re: Memory leak when using TTeeGDIPlus

Post by Yeray » Fri Jun 11, 2010 10:30 am

Hi Amadeus,

You are right. I could reproduce it so I've added it to the defect list to be revised in future releases (TV52014961).
Thanks for reporting it.
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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Memory leak when using TTeeGDIPlus

Post by Narcís » Fri Jun 11, 2010 1:26 pm

Hi Amadeus,
While I'm at it: seems there's another one in Chart.pas ->TLegendSymbol.Draw()

OldBrush:=TBrush.Create;

OldBrush doesn't get freed.
Yes, we found that some weeks ago and fixed it for the next maintenance release.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Memory leak when using TTeeGDIPlus

Post by Narcís » Tue Jun 15, 2010 2:17 pm

Hi Amadeus,

Just wanted to let you know that TV52014961 has been fixed for the next maintenance release. To fix this you can add line below to GDI+ canvas constructor (TGDIPlusCanvas.Create) and remove it from TGDIPlusCanvas.InitWindow.

Code: Select all

  IXORCanvas:=TTeeCanvas3D.Create;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Kubach
Newbie
Newbie
Posts: 6
Joined: Tue May 11, 2010 12:00 am

Re: Memory leak when using TTeeGDIPlus

Post by Kubach » Wed Jun 16, 2010 8:41 am

Yes, this does the trick.
Thanks for the quick help. It's appreciated

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Memory leak when using TTeeGDIPlus

Post by Narcís » Wed Jun 16, 2010 8:45 am

Kubach,

You're very welcome. Thanks for your feedback too!
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply