BrowserREPL-button-tip-on BrowserREPL-button-tip-off

EditButtonTip 2022-04-12

role Metamodel::Finalization

Metaobject supporting object finalization

role Metamodel::Finalization { ... }
Code

Warning: this role is part of the Rakudo implementation, and is not a part of the language specification.

This role takes care that DESTROY submethods are called (if they exist) when an object is garbage-collected.

Methods§

method setup_finalization§

method setup_finalization($obj)
Code

Collects the DESTROY submethods from this class and all its superclasses, and marks the class as needing action on garbage collection.

A metamodel for a kind that implements finalization semantics must call this method at type composition time.

method destroyers§

method destroyers($obj --> List:D)
Code

Returns a list of all finalization methods.