destructor Destroy; override;
Disposes of an object instance. It is not recommended coding style to call Destroy directly. Call Free instead. Free checks to ensure that the object reference is not nil before calling Destroy.
Destroy defined by TObject does nothing special, however memory deallocation is handled automatically when Destroy is called. Descendant objects usually define a destructor that is customized to destroy that particular kind of object.
When declaring a Destroy method in a descendant object class, always add the override directive to the declaration and call the inherited Destroy as the last statement in the overriding method. Since Destroy is a virtual method, overriding it ensures that the proper inherited behavior occurs.
Note: If an exception escapes from the constructor, the destructor is called to destroy the partially constructed object instance that failed to initialize completely. Therefore, destructors should check that allocated resources, such as handles, were actually allocated before trying to release them, since their value might be zero.
Destroy should be implemented so that it calls Free on all sub-objects created within the object’s constructor (that is, allocated by the constructor). Unlike Destroy, Free provides a safeguard when destroying objects that are nil.