Previous Object Programming: The Basics of Using Objects in IDL Next

Destroying Objects

Use the OBJ_DESTROY procedure to destroy an object. When an object is created using OBJ_NEW, memory is reserved for the object on the heap (see Object Heap Variables for details). You must explicitly destroy objects in order to clean up the reference and the remove the data from memory. Objects are released as with a call to OBJ_DESTROY. Internally, this calls the object's Cleanup method (see Destruction for details).

For example, if you have created an axis object called myAxis, use the following syntax to clean up the object reference:

OBJ_DESTROY, myAxis  

See OBJ_DESTROY for further details.

  IDL Online Help (March 06, 2007)