Sign in Join
FPDoc Onlineexperiment

TObject.Free procedure

Member of TObjectIn unit Objects

Destroy an object and release all memory.

Declaration

pascal
procedure Free

Description

Free calls the destructor of the object, and releases the memory occupied by the instance of the object.

Errors

No checking is performed to see whether self is nil and whether the object is indeed allocated on the heap.

See also

Example: ex7

pascal
program ex7;

{ Program to demonstrate the TObject.Free call }

Uses Objects;

Var O : PObject;

begin
  // Allocate memory for object.
  O:=New(PObject,Init);
  // Free memory of object.
  O^.free;
end.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.