A scope to ease the management of objects that require manual resource management.

Hierarchy

  • ManagedFreeableScope

Constructors

Properties

Methods

Constructors

Properties

#disposed: boolean = false
#scopeStack: Freeable[] = []

Methods

  • Once the freeable objects being managed are no longer being accessed, call this method.

    Returns void

  • Objects passed to this method will then be managed by the instance.

    Returns

    The freeable object passed in, which can be undefined.

    Type Parameters

    Parameters

    • freeable: T

      An object with a free function, or undefined. This makes it suitable for wrapping functions that may or may not return a value, to minimise the implementation logic.

    Returns T

Generated using TypeDoc