View Issue Details

IDProjectCategoryView StatusLast Update
0035627PackagesOtherpublic2020-03-26 15:06
ReporterMuhammad Reza Zare Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformFPC 3.3.1 svn AMD64OSArchLinux 
Product Version2.1 (SVN) 
Summary0035627: AVLTree for TFreeTypeFont add glyphs every time want to render them.
DescriptionAVLTree for TFreeTypeFont add glyphs every time want to render them.
I`m using BGRABitmap to render forms in fpGUI,
After a while just looking for memory usage of and compare to fpGUI native canvas!
And any invalidate of forms cause of increasing memory usage!

Another thing That closing App cause of hanging it, Pause of the app in debug mode guide me to the freeing the AVLTree nodes, Nodes of the TFreeTypeFont.
A simple trace showed me that GetGlyph just adds any glyph again on the tree! Because of the added glyphs sorts by the AVLTree logic not by Index key of the TFreeTypeFont objects!
I set an onCompare method for AVLTree and problem solved!
The code you can find here :
https://forum.lazarus.freepascal.org/index.php/topic,45503.0.html
Steps To ReproduceTry to Draw text with noGUI with BGRABitmap and Freetype based on LazUtil
Any glyph of the font will add every time of a character will draw.
TagsNo tags attached.
Fixed in Revisionr61291
LazTarget-
WidgetsetCustomDrawn
Attached Files

Relationships

has duplicate 0036827 resolvedJuha Manninen Lazarus [LazFreeType] findGlyphNode does not find existing glyps (Huge memory leak) 

Activities

Juha Manninen

2019-05-25 11:40

developer   ~0116405

I added the OnCompare func. Please test.
Widgetset should not be CustomDrawn but it cannot be removed for some reason.
In future you can learn to provide patches.
 http://wiki.freepascal.org/Creating_A_Patch

Muhammad Reza Zare

2019-05-25 14:09

reporter   ~0116409

Yes, it works as expected. Thanks,
I will try to provide a patch for the future...

Issue History

Date Modified Username Field Change
2019-05-24 13:21 Muhammad Reza Zare New Issue
2019-05-24 13:21 Muhammad Reza Zare Status new => assigned
2019-05-24 13:21 Muhammad Reza Zare Assigned To => Felipe Monteiro de Carvalho
2019-05-25 11:16 Juha Manninen Category Custom Drawn => Other
2019-05-25 11:16 Juha Manninen LazTarget => -
2019-05-25 11:16 Juha Manninen Widgetset CustomDrawn => CustomDrawn
2019-05-25 11:17 Juha Manninen Widgetset CustomDrawn => CustomDrawn
2019-05-25 11:33 Juha Manninen Assigned To Felipe Monteiro de Carvalho => Juha Manninen
2019-05-25 11:40 Juha Manninen Status assigned => resolved
2019-05-25 11:40 Juha Manninen Resolution open => fixed
2019-05-25 11:40 Juha Manninen Fixed in Revision => r61291
2019-05-25 11:40 Juha Manninen Widgetset CustomDrawn => CustomDrawn
2019-05-25 11:40 Juha Manninen Note Added: 0116405
2019-05-25 14:09 Muhammad Reza Zare Note Added: 0116409
2020-03-26 15:06 Juha Manninen Relationship added has duplicate 0036827