* Dispose of all registered disposables but do not mark this object as disposed.
()
| 118 | * Dispose of all registered disposables but do not mark this object as disposed. |
| 119 | */ |
| 120 | public clear(): void { |
| 121 | if (this._toDispose.size === 0) { |
| 122 | return; |
| 123 | } |
| 124 | |
| 125 | try { |
| 126 | dispose(this._toDispose); |
| 127 | } finally { |
| 128 | this._toDispose.clear(); |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | /** |
| 133 | * Add a new {@link IDisposable disposable} to the collection. |