[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Classes' (#rtl)

# TDataModule.OnDestroy

Event handler, called when the datamodule is destroyed.

## Declaration

Source position: classesh.inc line 2164

`published property TDataModule.OnDestroy : TNotifyEvent read FOnDestroy write FOnDestroy;`

## Description

The OnDestroy event is triggered when the datamodule is destroyed The exact moment of triggering is dependent on the value of the OldCreateOrder property.

## See also

TDataModule.Destroy |  | Destroys the TDataModule instance.
TDataModule.OnCreate |  | Event handler, called when the datamodule is created.
TDataModule.Create |  | Create a new instance of a TDataModule.
TDataModule.CreateNew |  |
TDataModule.OldCreateOrder |  | Determines when OnCreate and OnDestroy are triggered.

Documentation generated on: May 14 2021