Hi,
I'm using the v2010 version and it seems, I’ve encountered a GDI resource problem when using GDI+.
When I set the transparency of say a TBarSeries and use TTeeGDIPlus to render it, I’ve noticed that the number of GDI handles steadily increases whenever a repaint occurs.
I’ve tried to find out why and noticed a difference between the TeCanvas implementation and the GDIPlusCanvas one:
While in TeCanvas the Blend is freed:
procedure TTeeCanvas.EndBlending(Blend:TTeeBlend);
begin
Blend.DoBlend(ITransp);
Blend.Free;
end;
it isn’t in the GDI+ one:
procedure TGDIPlusCanvas.EndBlending(Blend:TTeeBlend);
begin
Transparency:=255;
end;
Could this be the reason?
GDI resource leak in v2010
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: GDI resource leak in v2010
Hi Kubach,
I'm not even sure there's a leak here. Could you please elaborate on why do you think there's a link and how can we reproduce that?
Thanks in advance.
I'm not even sure there's a leak here. Could you please elaborate on why do you think there's a link and how can we reproduce that?
Thanks in advance.
Best Regards,
Narcís Calvet / 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: GDI resource leak in v2010
I've attached a demo project and two screenshots. One right after the app start, the other after 10 clicks on the button.
- Attachments
-
- ChartGDIPlusLeak.7z
- (107.48 KiB) Downloaded 224 times
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: GDI resource leak in v2010
Hi Kubach,
Thanks for your feedback. I could reproduce the issue and it seems adding Blend.Free at EndBlending solves the problem:
Thanks for your feedback. I could reproduce the issue and it seems adding Blend.Free at EndBlending solves the problem:
Code: Select all
procedure TGDIPlusCanvas.EndBlending(Blend:TTeeBlend);
begin
Transparency:=255;
Blend.Free;
end
Best Regards,
Narcís Calvet / 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: GDI resource leak in v2010
Thanks for the quick response.
Works!
Works!
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: GDI resource leak in v2010
Hi Kubach,
You're very welcome
I have added the fix for next 2010 maintenance release too.
You're very welcome
I have added the fix for next 2010 maintenance release 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 |
Instructions - How to post in this forum |