Finalizable

Properties

5

Class hierarchy

isFinalizable: Boolean= truereadonly
Identifies an object as an instance of Finalizable class, or subclass thereof.
isFinalizable: Boolean= truereadonlystatic
Identifies an object as an instance of Finalizable class, or subclass thereof.

Other

finalizer: Promise

This property can be set any time prior to calling finalize (i.e., when the isFinalizing property goes to true). When set, this instance will await this promise before completing the finalization process by calling doFinalize.

isFinalized: Booleanreadonly

This property is true once the instance completes the finalize method.

isFinalizing: Booleanreadonly

This property is set to true when finalize is called.

Functions

2

This template method is called at the end of finalize. By default it calls destroy(), but can be replaced by the derived class. This can be useful if it is not the Finalizable instance that awaits the finalize method.

This method is called (typically by this instance or its owner) to cleanup this instance while possibly first waiting for the finalizer promise to settle. Once settled, the doFinalize method is called.