RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomForm.Release Method

Destroys the form and frees its associated memory.

Pascal
procedure Release;
C++
__fastcall Release();

Use Release to destroy the form and free its associated memory. 

Release does not destroy the form until all event handlers of the form and event handlers of components on the form have finished executing. Release also guarantees that all messages in the form's event queue are processed before the form is released. Any event handlers for the form or its children should use Release instead of Free (Delphi) or delete (C++). Failing to do so can cause a memory access error.

Note: Release returns immediately to the caller. It does not wait for the form to be freed before returning.
 

 

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