TButtonGlyph.Destroy
Destroy - destructor for TButtonGlyph: frees caches and calls inherited Destroy.
Declaration
Source position: buttons.pp line 119
Description
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 Destroy with the override directive, because it is a virtual method.
- Always call the inherited Destroy method 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 Destroy will be called, so your destructor must check if the resources were really allocated before the are released.
- Remember to call Free for all objects created on the constructor.
See also