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

# TDataModule.BeforeDestruction

## Declaration

Source position: classesh.inc line 2158

`public procedure TDataModule.BeforeDestruction; override;`

## Description

BeforeDestruction calls the OnDestroy handler if the OldCreateOrder property is False.

## See also

TDataModule.OldCreateOrder |  | Determines when OnCreate and OnDestroy are triggered.
TDataModule.OnDestroy |  | Event handler, called when the datamodule is destroyed.