RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TObject::BeforeDestruction Method

Responds before the first destructor executes.

Pascal
procedure BeforeDestruction; virtual;
C++
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::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) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!