RAD Studio VCL Reference
TObject::BeforeDestruction Method

Responds before the first destructor executes.

procedure BeforeDestruction; virtual;
virtual __fastcall BeforeDestruction();

System::TObject::BeforeDestruction is called automatically before the object's first destructor executes. Do not call it explicitly in your applications. 

The System::TObject::BeforeDestruction method implemented in System::TObject does nothing. Override this method when creating a class that takes some action before the object is destroyed. For example, TCustomForm overrides System::TObject::BeforeDestruction to generate an OnDestroy event.

Note: System::TObject::BeforeDestruction is not called when the object is destroyed before it is fully constructed. That is, if the object's constructor raises an exception, the destructor is called to dispose of the object, but System::TObject::BeforeDestruction is not called.


Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!