help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



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

TObject.Destroy

TObject destructor.

Declaration

Source position: objpash.inc line 149

public destructor TObject.Destroy; virtual;

Description

Destroy is the destructor of TObject. It will clean up the memory assigned to the instance. Descendent classes should override destroy if they want to do additional clean-up. No other destructor should be implemented.

It is bad programming practice to call Destroy directly. It is better to call the Free method, because that one will check first if Self is different from Nil.

To clean up an instance and reset the refence to the instance, it is best to use the FreeAndNil function.

See also

Create

  

TObject Constructor

Free

  

Check for Nil and call destructor.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505