Ver Mensaje Individual
  #6  
Antiguo 11-05-2005
Avatar de Ohcan
[Ohcan] Ohcan is offline
Miembro Premium
 
Registrado: ago 2004
Ubicación: Madrid (España)
Posts: 119
Reputación: 20
Ohcan Va por buen camino
Question FreeAndNil

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?
__________________
La violencia es el último recurso del incompetente. (Salvor Hardin)
Responder Con Cita