View Issue Details

IDProjectCategoryView StatusLast Update
0036827LazarusPackagespublic2020-03-26 15:07
ReporterEric Heijnen Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionduplicate 
PlatformX86_64OSWindows and Darwin 
Product Version2.0.7 (SVN) 
Summary0036827: [LazFreeType] findGlyphNode does not find existing glyps (Huge memory leak)
DescriptionIt often happens that findGlyphNode(Index) returns nil for an index that has previously been added
In a routine like TFreeTypeFont.GetGlyph which is used for textrendering this will end up allocating memory quite a lot

It doesn't happen with all strings, but one that causes it is :'this is a test'
Steps To ReproduceThe lazarus example for FreeType. Tick the rect box (as it uses a string that does trigger the issue) and move the mouse. You'll see the memory usage go up quickly
TagsNo tags attached.
Fixed in Revision
LazTarget-
WidgetsetWin32/Win64, Cocoa
Attached Files

Relationships

duplicate of 0035627 resolvedJuha Manninen Packages AVLTree for TFreeTypeFont add glyphs every time want to render them. 

Activities

Eric Heijnen

2020-03-26 00:29

reporter   ~0121715

Last edited: 2020-03-26 01:07

View 4 revisions

Sorry, that should have been :'This is a test' with capital T the lowercase one is fine

(lazutils, EasyLAzFreeType.pas)

edit2:
it's because in constructor TFreeTypeFont.Create the FGlyphTable object is created without specifying a sortroutine, so inserts end up sorted by pointervalue, which is useless in this case. Implementing a proper sort fixes it

Juha Manninen

2020-03-26 08:44

developer   ~0121717

Can you please create a patch to fix it.
 https://wiki.lazarus.freepascal.org/Creating_A_Patch

Eric Heijnen

2020-03-26 13:00

reporter   ~0121719

Looks like it's fixed in the trunk rev 61291 may 25 2019. Just never got to the fixes branch

Juha Manninen

2020-03-26 15:07

developer   ~0121720

Ok, resolving. Please check Lazarus trunk in future before reporting.

Issue History

Date Modified Username Field Change
2020-03-26 00:15 Eric Heijnen New Issue
2020-03-26 00:29 Eric Heijnen Note Added: 0121715
2020-03-26 00:52 Eric Heijnen Note Edited: 0121715 View Revisions
2020-03-26 01:06 Eric Heijnen Note Edited: 0121715 View Revisions
2020-03-26 01:07 Eric Heijnen Note Edited: 0121715 View Revisions
2020-03-26 08:44 Juha Manninen Note Added: 0121717
2020-03-26 13:00 Eric Heijnen Note Added: 0121719
2020-03-26 15:06 Juha Manninen Relationship added duplicate of 0035627
2020-03-26 15:07 Juha Manninen Assigned To => Juha Manninen
2020-03-26 15:07 Juha Manninen Status new => resolved
2020-03-26 15:07 Juha Manninen Resolution open => duplicate
2020-03-26 15:07 Juha Manninen LazTarget => -
2020-03-26 15:07 Juha Manninen Widgetset Win32/Win64, Cocoa => Win32/Win64, Cocoa
2020-03-26 15:07 Juha Manninen Note Added: 0121720