disposable
Factor handbook » The language » Deterministic resource disposal » Writing new destructors

Next:new-disposable ( class -- disposable )


Vocabulary
destructors

Class description
Parent class for disposable resources. This class has two slots:
disposedA boolean value, set to true by dispose. Assert that it is false with check-disposed.
continuationThe current continuation at construction time, for debugging. Set by new-disposable if debug-leaks? is on.

New instances must be constructed with new-disposable and subclasses must implement dispose*.

Definition


Methods