Skip to content

Commit

Permalink
fix: ensure TestModelCollection is disposed
Browse files Browse the repository at this point in the history
  • Loading branch information
ruifigueira committed Jul 31, 2024
1 parent 3c8c31e commit 27684b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ export class Extension implements RunHooks {
this._reusedBrowser,
this._diagnostics,
this._treeItemObserver,
this._models,
registerTerminalLinkProvider(this._vscode),
];
const fileSystemWatchers = [
Expand Down
6 changes: 5 additions & 1 deletion src/testModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -709,10 +709,14 @@ export class TestModelCollection extends DisposableBase {

clear() {
this.dispose();
this._didUpdate.fire();
}

dispose() {
super.dispose();
for (const model of this._models)
model.reset();
this._models = [];
this._didUpdate.fire();
}

enabledModels(): TestModel[] {
Expand Down

0 comments on commit 27684b6

Please sign in to comment.