On Sat, 13 Apr 2013, Zaher Dirkey wrote:

Is it safe to free memeber object after call inherited in Destroy?
in Delphi/ObjFPC modes

type TMyObject=class(TObject)
   FMyMember:TmyMemberObject;
....

destructor TMyObject.Destroy;
begin
  inherited Destroy;
  FreeAndNil(FMyMember);
end;

This should be OK, but I would not recommend it when using e.g. components.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to