Skip to main content
Version: Version 5

Interface: Disposable

Disposable defines a contract for objects that require explicit cleanup or resource release when they are no longer needed. Classes implementing this interface should provide a dispose method to perform the necessary cleanup.

Methods

dispose()

dispose(): void

Disposes of the object, releasing any resources it holds.

The dispose method is responsible for performing cleanup operations and releasing any resources acquired by the object. Once an object is disposed, it should not be used, and attempts to do so may result in undefined behavior.

Returns

void