De la ayuda de Delphi:
Cita:
FreeAndNil procedure
Frees an object reference and replaces the reference with nil (Delphi) or NULL (C++).
Unit
SysUtils
Category
Pointer and address routines
Delphi syntax:
procedure FreeAndNil(var Obj);
C++ syntax:
extern PACKAGE void __fastcall FreeAndNil(void *Obj);
Description
Use FreeAndNil to ensure that a variable is nil (Delphi) or NULL (C++) after you free the object it references. Pass any variable that represents an object as the Obj parameter.
Warning: Obj must be an instance of a TObject descendant.
|
Entonces... ¿no sería mejor usar siempre ésto en vez del .free?