dispose Function
Convenience function for disposing of a disposable object that may be undefined. This is primarily used to simplify implementations of dispose. As a simple example:
class Disposable implements IDisposable {
public member1?: DisposableType1;
public member2?: DisposableType2;
public dispose() {
this.member1 = dispose(this.member1); // If member1 is defined, dispose of it and set it to undefined.
this.member2 = dispose(this.member2); // Likewise for member2.
}
}
dispose(disposable?: IDisposable): undefined
@returns undefined
Parameter | Type | Description |
---|---|---|
disposable | IDisposable | The object to be disposed of. |
Returns - undefined
undefined
Defined in
- core/bentley/src/Disposable.ts Line 57
Last Updated: 14 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.