[fpc-devel] Memory leak with interfaces in fpc2.0.4.rc3

Inoussa OUEDRAOGO inoussa12 at gmail.com
Fri Aug 18 21:56:40 CEST 2006


Hi
The attached progam demonstrates a memory leak which is not present in 2.0.2

1- When the program is compiled with 2.0.2, the results are :
[listing 2.0.2]
Creating >>> 544436
  called in test
Creating >>> 544468
  called in proc1
Destroying >>> 544468
Destroying >>> 544436
Remaining instances ... 0
[/listing 2.0.2]

1- When the program is compiled with 2.0.2, the results are :
[listing 2.0.2]
Creating >>> 544436
  called in test
Creating >>> 544468
  called in proc1
Destroying >>> 544468
Destroying >>> 544436
Remaining instances ... 0
[/listing 2.0.2]

2- When the program is compiled with 2.0.4.rc3, the results are :
[listing 2.0.4.rc3]
Creating >>> 675784
  called in test
Creating >>> 676072
  called in proc1
Destroying >>> 676072
Remaining instances ... 1
[/listing 2.0.4.rc3]

and the "HeapTrc" unit output are

[HeapTrc]
E:\Inoussa\Sources\lazarus\tests\interfaces\test_intf.exe
Heap dump by heaptrc unit
53 memory blocks allocated : 987/1192
52 memory blocks freed     : 971/1176
1 unfreed memory blocks : 16
True heap size : 196608 (208 used in System startup)
True free heap : 196304
Should be : 196328
Call trace for block $000A4FC8 size 16
  $00402608  TOBJECT__NEWINSTANCE,  line 177 of
C:/lazarus/source/fpcbuild/2.0.4-rc3/fpcsrc/rtl/inc/objpas.inc
  $00401B3E  TINTERFACEDOBJECT__NEWINSTANCE,  line 705 of
C:/lazarus/source/fpcbuild/2.0.4-rc3/fpcsrc/rtl/inc/objpas.inc
  $004010CA  TTEST__CREATE,  line 33 of test_intf.pas
  $004012C0  TEST,  line 53 of test_intf.pas
  $0040133F  main,  line 58 of test_intf.pas
  $004013EE  EXE_ENTRY,  line 420 of system.pp
[/HeapTrc]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_intf.pas
Type: application/octet-stream
Size: 826 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20060818/6744f2ec/attachment.obj>


More information about the fpc-devel mailing list