[Lazarus] Is this a bug?

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Jun 16 09:33:25 CEST 2017


On Fri, 16 Jun 2017 19:12:31 +1200
Wolf via Lazarus <lazarus at lists.lazarus-ide.org> wrote:

> The following program produces these two memory leaks:
> 
> Heap dump by heaptrc unit
> 2 memory blocks allocated : 188/208
> 0 memory blocks freed     : 134/144
> 2 unfreed memory blocks : 54
> True heap size : 32768
> True free heap : 32320
> Should be : 32448
> Call trace for block $00007FFFF7FF31A0 size 27
> Call trace for block $00007FFFF7FF30C0 size 27
> 
> If the call to "halt;" is commented out, there is no memory leak 
> reported. Is this intentional?

Yes.
"Halt" immediately jump to the finalization sections. That means any
try..finally sections are skipped, including the implicit frees for
the temporary strings of your example.

Mattias


More information about the Lazarus mailing list