From 27684b62cb4f3f6dc0debca7885041b003409b2a Mon Sep 17 00:00:00 2001 From: Rui Figueira Date: Wed, 31 Jul 2024 04:05:36 +0100 Subject: [PATCH] fix: ensure TestModelCollection is disposed --- src/extension.ts | 1 + src/testModel.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/extension.ts b/src/extension.ts index 0f39d5d66..1ddfc89af 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -228,6 +228,7 @@ export class Extension implements RunHooks { this._reusedBrowser, this._diagnostics, this._treeItemObserver, + this._models, registerTerminalLinkProvider(this._vscode), ]; const fileSystemWatchers = [ diff --git a/src/testModel.ts b/src/testModel.ts index 80595250d..4bb5fec55 100644 --- a/src/testModel.ts +++ b/src/testModel.ts @@ -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[] {