Fail instruction in class constructor causes a memory leak.
Original Reporter info from Mantis: Paradice
-
Reporter name:
Original Reporter info from Mantis: Paradice
- Reporter name:
Description:
The following program causes heaptrc to output a memory leak:
program failtest;
uses
heaptrc;
type
TMyClass = class
constructor Create;
end;
constructor TMyClass.Create;
begin
Fail;
end;
var
MyClass : TMyClass;
begin
MyClass := TMyClass.Create;
MyClass.Free;
end.
Additional information:
Program output (compiled with FPC 2.2.0 stable, i386 Win32)
E:\Projects\tests>failtest
Heap dump by heaptrc unit
1 memory blocks allocated : 4/8
0 memory blocks freed : 0/0
1 unfreed memory blocks : 4
True heap size : 98304 (112 used in System startup)
True free heap : 98112
Should be : 98128
Call trace for block $00094FF8 size 4
$00403772
$00401484 main, line 20 of E:/Projects/tests/failtest.pp
Mantis conversion info:
- Mantis ID: 10790
- Version: 2.2.0
- Fixed in version: 2.2.2
- Fixed in revision: 10391 (#dbe42035)