mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
24 lines
687 B
TypeScript
24 lines
687 B
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import * as vscode from 'vscode';
|
|
|
|
export class DisposableStore {
|
|
|
|
private disposables = new Set<vscode.Disposable>();
|
|
|
|
add(disposable: vscode.Disposable): void {
|
|
this.disposables.add(disposable);
|
|
}
|
|
|
|
dispose(): void {
|
|
for (const disposable of this.disposables) {
|
|
disposable.dispose();
|
|
}
|
|
|
|
this.disposables.clear();
|
|
}
|
|
}
|