Skip to content

Commit

Permalink
Merge pull request microsoft#209371 from microsoft/tyriar/207459
Browse files Browse the repository at this point in the history
Fix leaks in terminalInstance dnd
  • Loading branch information
Tyriar committed Apr 2, 2024
2 parents 2d0c615 + 5aa71eb commit c78ef14
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/vs/workbench/contrib/terminal/browser/terminalInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1088,13 +1088,15 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
}

private _initDragAndDrop(container: HTMLElement) {
const dndController = this._register(this._scopedInstantiationService.createInstance(TerminalInstanceDragAndDropController, container));
dndController.onDropTerminal(e => this._onRequestAddInstanceToGroup.fire(e));
dndController.onDropFile(async path => {
const store = new DisposableStore();
const dndController = store.add(this._scopedInstantiationService.createInstance(TerminalInstanceDragAndDropController, container));
store.add(dndController.onDropTerminal(e => this._onRequestAddInstanceToGroup.fire(e)));
store.add(dndController.onDropFile(async path => {
this.focus();
await this.sendPath(path, false);
});
this._dndObserver.value = new dom.DragAndDropObserver(container, dndController);
}));
store.add(new dom.DragAndDropObserver(container, dndController));
this._dndObserver.value = store;
}

hasSelection(): boolean {
Expand Down

0 comments on commit c78ef14

Please sign in to comment.