Fix some connection listener leaks (#6357)

* Fix some connection listener leaks

* More descriptive name and update summary

* Dispose some more connections and fix a few spelling errors
This commit is contained in:
Charles Gagnon
2019-07-29 11:00:11 -07:00
committed by GitHub
parent 1d56a17f32
commit 86cde4c511
9 changed files with 66 additions and 28 deletions

View File

@@ -321,10 +321,14 @@ export class ConnectionDialogWidget extends Modal {
const actionProvider = this._instantiationService.createInstance(RecentConnectionActionsProvider);
const controller = new RecentConnectionTreeController(leftClick, actionProvider, this._connectionManagementService, this._contextMenuService);
actionProvider.onRecentConnectionRemoved(() => {
this.open(this._connectionManagementService.getRecentConnections().length > 0);
const recentConnections: ConnectionProfile[] = this._connectionManagementService.getRecentConnections();
this.open(recentConnections.length > 0);
recentConnections.forEach(conn => conn.dispose());
});
controller.onRecentConnectionRemoved(() => {
this.open(this._connectionManagementService.getRecentConnections().length > 0);
const recentConnections: ConnectionProfile[] = this._connectionManagementService.getRecentConnections();
this.open(recentConnections.length > 0);
recentConnections.forEach(conn => conn.dispose());
});
this._recentConnectionTree = TreeCreationUtils.createConnectionTree(treeContainer, this._instantiationService, controller);