DESTRUCTOR statement
- Last Updated: December 9, 2013
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
DESTRUCTOR statement
Syntax
This is the syntax for defining a class destructor:
|
Element descriptions for this syntax diagram follow:
- class-name
- The name of the class stripped of any relative path information.
This is the class-name portion
of the class-type-name defined
by the
CLASSstatement. - destructor-body
- The logic of the destructor, which can be composed of any ABL statements
allowed within a method block, except that any
RETURN ERRORorUNDO, THROWcannot raiseERRORbeyond the level of the destructor block. The destructor logic is normally used to free up any dynamic handle-based objects or other system resources in use by the class.
Adding a destructor to the sample class definition results in the following code:
|
In this definition, the clean-up work of the class destructor includes emptying a temp-table of all the records that the class creates for it. Note that all the other class instances that this class creates are automatically deleted through garbage collection. For more information on ABL garbage collection, see Garbage collection.