View source code Display the source code in core/runtime.d from which this page was generated on github. Improve this page Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone. Page wiki View or edit the community-maintained wiki page associated with this page.

core.runtime.runtime.collect_handler - multiple declarations

Function Runtime.collectHandler

Overrides the default collect hander with a user-supplied version. This routine will be called for each resource object that is finalized in a non-deterministic manner--typically during a garbage collection cycle. If the supplied routine returns true then the object's dtor will called as normal, but if the routine returns false than the dtor will not be called. The default behavior is for all object dtors to be called.

Prototype

static void collectHandler(
  bool function(Object) h
) @property;

Parameters

NameDescription
h The new collect handler. Set to null to use the default handler.

Function Runtime.collectHandler

Gets the current collect handler.

Prototype

static bool collectHandler(
  void 
) @property;

Returns

The current collect handler or null if none has been set.

Authors

Sean Kelly

License

Boost License 1.0

Comments