Sign in Join
Wiki copytemporary

Dispose

Deutsch · English

Back to Reserved words.

The reserved word dispose belongs to object-oriented programming.

The reserved word dispose releases the memory by reducing the reference counter to the memory object by 1. If the reference counter of an object is 0, the memory object is released.

Example:

pascal
  var
   intI: ^ Integer;

 begin
   ...
   if assigned (intI) then ... // Checks whether an address has been assigned to intI
   ...
   new (intI);  // Assigns a valid address to intI
   ...
   dispose (intI);  // Releases the address
   ...

From the Free Pascal wiki, page "Dispose", as it stood on 2020-02-13 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.