Ver Mensaje Individual
  #2  
Antiguo 23-06-2004
Avatar de jachguate
jachguate jachguate is offline
Miembro
 
Registrado: may 2003
Ubicación: Guatemala
Posts: 6.254
Reputación: 28
jachguate Va por buen camino
En la VCL, destroy es el destructor de la clase, que es un método virtual. Free es un método estático definido en TObject, que valida que no se esté llamando desde una referencia a nil, y llama a Destroy.

Cita:
Empezado por delphi help
Use Free to destroy an object. Free automatically calls the destructor if the object reference is not nil. Any object instantiated at runtime that does not have an owner should be destroyed by a call to Free so that it can be properly disposed of and its memory released. Unlike Destroy, Free is successful even if the object is nil; so if the object was never initialized, Free won’t result in an error.
De hecho, Borland recomienda destruir los objetos llamando a Free y no directamente a Destroy.

Hasta luego.

__________________
Juan Antonio Castillo Hernández (jachguate)
Guía de Estilo | Etiqueta CODE | Búsca antes de preguntar | blog de jachguate
Responder Con Cita