[fpc-pascal] destructor
Mattias Gaertner
nc-gaertnma at netcologne.de
Tue Jan 24 12:48:12 CET 2017
Hi,
fpc allows to declare a method with the destructor keyword, that is
not a real destructor, because it does not free the memory. For what is
this feature good for?
For example:
Type
TClassA = class
public
destructor Foo;
end;
destructor TClassA.Foo;
begin
end;
var
o: TClass;
begin
o:=TClass.Create;
o.Foo; // does not call FreeInstance
o.Destroy; // does call FreeInstance
end.
Mattias
More information about the fpc-pascal
mailing list