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
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to