View Issue Details

IDProjectCategoryView StatusLast Update
0038768LazarusIDEpublic2021-04-20 12:24
ReporterJoeny Ang Assigned ToMattias Gaertner  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version2.1 (SVN) 
Summary0038768: [Patch] TOICustomPropertyGrid memory leak
DescriptionWhen using TOICustomPropertyGrid.OnEditorFilter() to hide sub properties of
a class, the property editors of the hidden props are not being freed.

Steps To ReproduceCompile the test app with debugging. Run and click on "Select TFontDialog".
Expand the Font property. Then close the app.
TagsNo tags attached.
Fixed in Revision65013.
LazTarget-
Widgetset
Attached Files

Activities

Joeny Ang

2021-04-17 06:04

reporter  

Joeny Ang

2021-04-17 06:05

reporter   ~0130419

Last edited: 2021-04-17 06:05

View 3 revisions

I think the problem is somewhere in the following lines, where it only frees
the editor if it was for a set element. Maybe we should remove the check and
free any editor as long as it is hidden?

components/ideintf/objectinspector.pp
2140 ...
2141 procedure TOICustomPropertyGrid.AddSubEditor(PropEditor:TPropertyEditor);
2142 var
2143   NewRow:TOIPropertyGridRow;
2144   NewIndex:integer;
2145 begin
2146   if not EditorFilter(PropEditor) then
2147   begin
2148     // if some elements of a set is not being shown then free their editor
2149     // to avoid memory leaks; sine only visible editors will be cleared.
2150     if PropEditor.ClassType = TSetElementPropertyEditor then
2151       PropEditor.Free;
2152     Exit;
2153   end;
2154 ...

Mattias Gaertner

2021-04-17 13:35

manager   ~0130425

Thanks for the hint!

Joeny Ang

2021-04-20 12:23

reporter   ~0130476

Ok now. Thanks :)

Issue History

Date Modified Username Field Change
2021-04-17 06:04 Joeny Ang New Issue
2021-04-17 06:04 Joeny Ang File Added: toicustompropertygrid-memory-leak-test01.zip
2021-04-17 06:05 Joeny Ang Note Added: 0130419
2021-04-17 06:05 Joeny Ang Note Edited: 0130419 View Revisions
2021-04-17 06:05 Joeny Ang Note Edited: 0130419 View Revisions
2021-04-17 13:35 Mattias Gaertner Assigned To => Mattias Gaertner
2021-04-17 13:35 Mattias Gaertner Status new => resolved
2021-04-17 13:35 Mattias Gaertner Resolution open => fixed
2021-04-17 13:35 Mattias Gaertner Fixed in Revision => 65013.
2021-04-17 13:35 Mattias Gaertner LazTarget => -
2021-04-17 13:35 Mattias Gaertner Note Added: 0130425
2021-04-20 12:23 Joeny Ang Note Added: 0130476
2021-04-20 12:24 Joeny Ang Status resolved => closed