[Overview][Types][Classes][Procedures and functions][Variables][Index] |
Destroy - destructor for TCustomBitBtn: frees Button Glyph then calls inherited Destroy
Source position: buttons.pp line 173
public destructor TCustomBitBtn.Destroy; override; |
If you call Destroy for an object which hasn´t being initialized yet it will generate an error. Always use the Free method to deallocate objects, because it verifies if object variable doesn´t 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 'inherited Destroy;' as the last thing on the destructor code. * An exception may be raised on the constructor in case there is not enought 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 disposing of them. * Remember to call Free for all objects created on the constructor.
TCustomButton.Destroy |
lazarus-ccr.sourceforge.net |