Just curious, I tried putting a managed type on the record and not using finalize. However, it says there's no memory leak. What's the problem with not calling "finalize"?
type
ciccio = record
a : String;
class operator Initialize(var value:ciccio);
end;
var
c : ciccio;
{ ciccio }
class operator ciccio.Initialize(var value: ciccio);
begin
value.a:='pippo';
end;
begin
WriteLn(c.a);
c.a := 'caio';
WriteLn(c.a);
Initialize(c);
c.a := 'caio2';
WriteLn(c.a);
Initialize(c);
c.a := 'caio3';
WriteLn(c.a);
Initialize(c);
WriteLn(c.a);
end.
0 memory blocks allocated : 0/0
0 memory blocks freed : 0/0
0 unfreed memory blocks : 0
True heap size : 0
True free heap : 0