[Overview][Types][Classes][Procedures and functions][Index] | Reference for unit 'ExtCtrls' (#lcl)

# TCustomShape.Destroy

Destructor for the class instance.

## Declaration

Source position: extctrls.pp line 295

`public destructor TCustomShape.Destroy; override;`

## Description

Destroy is the overridden destructor for the class instance. It ensures that resources allocated in the class instance, including the Pen and Brush, are freed. It calls the inherited destructor prior to exit to free the Canvas and other resources allocated in ancestor classes.

## See also

TCustomShape.Brush |  | The Brush used to fill the shaped control.
TCustomShape.Pen |  | The Pen used to draw lines on the shaped control.
TGraphicControl.Canvas |  | A clipped window into the parent Canvas.
TGraphicControl.Destroy |  | Destructor for the class instance.
TControl.Destroy |  | Removes the control from its Parent.