Handbook
Glossary
new-disposable ( class -- disposable )
Factor handbook
»
The language
»
Deterministic resource disposal
»
Writing new destructors
Prev:
disposable
Next:
dispose* ( disposable -- )
Vocabulary
destructors
Inputs
class
a
class
Outputs
disposable
a
disposable
Word description
Constructs a new instance of a subclass of
disposable
. This sets the
id
slot, registers the new object with the global
disposables
set, and if
debug-leaks?
is on, stores the current continuation in the
continuation
slot.
Definition
USING:
destructors.private
kernel
;
IN:
destructors
:
new-disposable
( class -- disposable )
new
dup
register-disposable
;
inline