Forum > TAChart

[Solved] Memory leaks when using TChart

<< < (2/3) > >>

wp:
Reported as https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41824

Wilko500:
Many thanks

Wilko500:
I have been doing additional testing on my prototype program.  We have established that memory leak is probably related to font creation, so I attempted to make all objects on my form default font.  This failed to clear the last two unfreed blocks. I did this by editing the .lfm files to remove all references to the font Tahoma that I had been using. Undeterred I continued investigations.

What I eventually discovered is that the two remaining unfreed blocks were caused by making any one of the labels DCDC1/DCDC2/Inverter visible (see pic).  I have two grpBoxes, one inside the other, all fonts in both are Tahoma.  Elsewhere on the form I have grpBoxes with both edit and labels all with Tahoma that work fine. 

The unfreed blocks only seem to occur with nested grpBox.  It was this nesting that made it so difficult to identify.  In the final version of my program I used panels rather than grpBoxes and I wonder if the same problem would occur with nested panels.  I have not had time to test this yet.

wp:
The Canvas.Font related memory leak in cocoa now has been fixed. Please test again.

Wilko500:
Have tested with Fpcupdeluxe - Trunk.  I am not seeing the memory leaks  :).  Have checked with the original test program and two other programs with far more complex GUI's.  None show memory leaks.  Next step will be test in live environment.  A necessary test because prior to the fix with all items causing leaks either deleted or made invisible, thus on compile and exit 0 leaks, still has continuous increase in "Private Memory Size" which eventually crashes the program.  I have no idea whether this is related to the canvas leak or something else.

Thank you, and the Team, for your help fixing this issue.

PS: With the latest Trunk I do see a significant difference in how the Chart left axis is being scaled.  I will create a new thread for this

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version