TButtonGlyph.Destroy destructor
Destroy - destructor for
TButtonGlyph: frees caches and
calls inherited
Destroy.Declaration
destructor Destroy; overrideDescription
If you call Destroy for an object which hasn't been initialized
yet, it will generate an error. Always use the Free method to
deallocate objects, because it verifies that the object does not contain the
value Nil.
Take the following precautions when creating your own Destroy
method:
- Declare
Destroywith the override directive, because it is a virtual method. - Always call the inherited
Destroymethod as the last action in the destructor code. - An exception may be raised in the constructor if there is not enough memory
to create an object, or something else goes wrong. If the exception is not
handled inside the constructor, the object will be only partially built. In
this case
Destroywill be called, so your destructor must check if the resources were really allocated before the are released. - Remember to call
Freefor all objects created on the constructor.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
