View Issue Details

IDProjectCategoryView StatusLast Update
0028616PatchesPatchpublic2015-09-03 12:12
ReporterOndrej Pokorny Assigned ToMattias Gaertner  
Status closedResolutionfixed 
Summary0028616: CodeTools: memory leak in hint window
DescriptionLazarus IDE is leaking memory in the CodeTools hint window.
Steps To ReproduceSee the attached image that points to the hint window that leaks memory.
Basically do:
1.) Start identifier completion (Control+Space).
2.) Wait until the identifier hint window is show.
3.) Exit Lazarus IDE. You'll get a heaptrc message about memory leaks.
Additional InformationPatch attached.

The problem was that TFPDocHintProvider.FHTMLControl was created without an owner and was not destroyed manually either. See line with

It has to be created with an owner assigned or it has to be destroyed manually in TFPDocHintProvider.Destroy (this is what the patch does).
TagsNo tags attached.
Fixed in Revision49749
Attached Files


Ondrej Pokorny

2015-09-03 12:04


codetools-memoryleak.png (9,694 bytes)   
codetools-memoryleak.png (9,694 bytes)   

Ondrej Pokorny

2015-09-03 12:05


codetools-memoryleak.patch (385 bytes)   
Index: ide/fpdochints.pas
--- ide/fpdochints.pas	(revision 49748)
+++ ide/fpdochints.pas	(working copy)
@@ -214,6 +214,7 @@
   // important: free provider before control
+  FreeAndNil(FHTMLControl);
   inherited Destroy;
codetools-memoryleak.patch (385 bytes)   

Mattias Gaertner

2015-09-03 12:08

manager   ~0085687

Thank You.

Issue History

Date Modified Username Field Change
2015-09-03 12:04 Ondrej Pokorny New Issue
2015-09-03 12:04 Ondrej Pokorny File Added: codetools-memoryleak.png
2015-09-03 12:05 Ondrej Pokorny File Added: codetools-memoryleak.patch
2015-09-03 12:08 Mattias Gaertner Fixed in Revision => 49749
2015-09-03 12:08 Mattias Gaertner LazTarget => -
2015-09-03 12:08 Mattias Gaertner Note Added: 0085687
2015-09-03 12:08 Mattias Gaertner Status new => resolved
2015-09-03 12:08 Mattias Gaertner Resolution open => fixed
2015-09-03 12:08 Mattias Gaertner Assigned To => Mattias Gaertner
2015-09-03 12:12 Ondrej Pokorny Status resolved => closed