System.Dispose

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure Dispose(var P: Pointer);

Properties

Type Visibility Source Unit Parent
procedure public System.pas System System

Description

Releases the memory allocated for a dynamic variable.

Dispose releases the memory allocated for a pointer variable allocated using System.New. For a pointer that was allocated using System.GetMem, use System.FreeMem to release the memory allocated. After a call to Dispose or FreeMem, the value of the pointer passed to it is undefined.

Note: If a pointer to unallocated memory is passed to Dispose, the behavior of the application largely depends on the target platform, as follows:

See Also

Code Examples