fix a few leaking listeners (#214024)

This commit is contained in:
Johannes Rieken 2024-05-31 18:14:50 +02:00 committed by GitHub
parent 0599ca4e7c
commit 73961d876d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View file

@ -390,7 +390,7 @@ export class ReferenceWidget extends peekView.PeekViewWidget {
this._onDidSelectReference.fire({ element, kind, source: 'tree' });
}
};
this._tree.onDidOpen(e => {
this._disposables.add(this._tree.onDidOpen(e => {
if (e.sideBySide) {
onEvent(e.element, 'side');
} else if (e.editorOptions.pinned) {
@ -398,7 +398,7 @@ export class ReferenceWidget extends peekView.PeekViewWidget {
} else {
onEvent(e.element, 'show');
}
});
}));
dom.hide(this._treeContainer);
}

View file

@ -256,7 +256,7 @@ export class OpenEditorsView extends ViewPane {
this.readonlyEditorFocusedContext = OpenEditorsReadonlyEditorContext.bindTo(this.contextKeyService);
this._register(this.list.onContextMenu(e => this.onListContextMenu(e)));
this.list.onDidChangeFocus(e => {
this._register(this.list.onDidChangeFocus(e => {
this.resourceContext.reset();
this.groupFocusedContext.reset();
this.dirtyEditorFocusedContext.reset();
@ -270,7 +270,7 @@ export class OpenEditorsView extends ViewPane {
} else if (!!element) {
this.groupFocusedContext.set(true);
}
});
}));
// Open when selecting via keyboard
this._register(this.list.onMouseMiddleClick(e => {

View file

@ -523,7 +523,7 @@ export class SearchWidget extends Widget {
}
}));
this.replaceInput.onKeyDown((keyboardEvent) => this.onReplaceInputKeyDown(keyboardEvent));
this._register(this.replaceInput.onKeyDown((keyboardEvent) => this.onReplaceInputKeyDown(keyboardEvent)));
this.replaceInput.setValue(options.replaceValue || '');
this._register(this.replaceInput.inputBox.onDidChange(() => this._onReplaceValueChanged.fire()));
this._register(this.replaceInput.inputBox.onDidHeightChange(() => this._onDidHeightChange.fire()));