Page 1 of 1

Memory leakage with XE4 and GDI

Posted: Mon Jun 17, 2013 10:31 am
by 16564359
Actually I move a previous project to XE4.
The program reports a memory leakage at shutdown:
An unexpected memory leakage has occurred. The unexpected small block leaks are:
85 - 92 bytes: TTeeGradient x 3
349 - 380 bytes: TTeeCanvas3D x 3
The sizes of unexpected leaked medium and large blocks are: 262700, 262700, 262700
I have 3 charts defined in the program. Now I have found when adding a new chart and rendering 3D with GDI the memory leakge increases from x3 to x4.
Changng all charts to GDI+ removes the memory leakage, no message then

But I prefer to use GDI. How to fix?

Regards
Uli

Re: Memory leakage with XE4 and GDI

Posted: Mon Jun 17, 2013 4:24 pm
by 16564359
I know a bit more now but still not enough to correct it.

TCustomTeePanel.Create (TeeProcs) calls by CreateDefaultCanvas the procedure TGDIPlusCanvas.Create (TeeGDIPlus).
When the rendering is set to GDI+ then also TGDIPlusCanvas.Destroy is called when the program finishes.

But if instead only GDI is selected a render option then TGDIPlusCanvas.Destroy is never called, leaving the created canvas as memory leakage.

Uli

Re: Memory leakage with XE4 and GDI

Posted: Wed Jun 19, 2013 4:03 pm
by 16564359
Hi,

so far Steema has not replied.
But the post of Vasek http://www.teechart.net/support/viewtop ... 180#p62180 also solves my problem.

Maybe Steema can confirm the solution?

Uli

Re: Memory leakage with XE4 and GDI

Posted: Fri Jun 21, 2013 7:10 am
by narcis
Hi Uli,

Yes, that's right, I just replied to Vasek's suggestion.