Skip to content

Commit f5db653

Browse files
authored
Fixes leaking disposable (microsoft#258209)
1 parent 7780183 commit f5db653

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vs/workbench/contrib/editTelemetry/browser/helpers/annotatedDocuments.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ export class AnnotatedDocuments extends Disposable {
4545
return map;
4646
});
4747

48-
const states = mapObservableArrayCached(this, this._workspace.documents, (doc, _store) => {
48+
const states = mapObservableArrayCached(this, this._workspace.documents, (doc, store) => {
4949
const docIsVisible = derived(reader => visibleUris.read(reader).has(doc.uri.toString()));
5050
const wasEverVisible = derivedObservableWithCache<boolean>(this, (reader, lastVal) => lastVal || docIsVisible.read(reader));
51-
return wasEverVisible.map(v => v ? this._instantiationService.createInstance(AnnotatedDocument, doc, docIsVisible) : undefined);
51+
return wasEverVisible.map(v => v ? store.add(this._instantiationService.createInstance(AnnotatedDocument, doc, docIsVisible)) : undefined);
5252
});
5353

5454
this.documents = states.map((vals, reader) => vals.map(v => v.read(reader)).filter(isDefined));

0 commit comments

Comments
 (0)