Skip to content

Commit 0aea3d1

Browse files
committed
Fix _activeLinks not being disposed of
Looks like we were calling forEach but not actually invoking `dispose` on the items. Switch to use `dispose(...)` to avoid this
1 parent 442227c commit 0aea3d1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/vs/workbench/contrib/terminal/browser/links/terminalBaseLinkProvider.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import type { ILinkProvider } from 'xterm';
6+
import { dispose } from 'vs/base/common/lifecycle';
77
import { TerminalLink } from 'vs/workbench/contrib/terminal/browser/links/terminalLink';
8+
import type { ILinkProvider } from 'xterm';
89

910
export abstract class TerminalBaseLinkProvider implements ILinkProvider {
1011
private _activeLinks: TerminalLink[] | undefined;
1112

1213
async provideLinks(bufferLineNumber: number, callback: (links: TerminalLink[] | undefined) => void): Promise<void> {
13-
this._activeLinks?.forEach(l => l.dispose);
14+
if (this._activeLinks) {
15+
dispose(this._activeLinks);
16+
}
1417
this._activeLinks = await this._provideLinks(bufferLineNumber);
1518
callback(this._activeLinks);
1619
}

0 commit comments

Comments
 (0)