Chapter 3 The Application Description Language

3.18 Object Destruction

AM2 destroys an object declared within a scope on exit from that scope. The delete operator also destroys an object. Apply it only to the handle of an object returned by the new or clone operators.

The default destruction of an object involves:

This may be insufficient if the object contains handles to other objects or data allocated using the new operator. So that you can specify custom actions to accompany an object's destruction, AM2 checks for a Destroy method whenever you delete an instance of a user-defined class. AM2 calls this method, if it exists in the deleted object's class, before the destruction of member objects and bases, and the freeing of object storage.


AM2 Documentation - 19 NOV 1996

Generated with Harlequin WebMaker