Parcourir la source

Fixes node leaks from subscriptions

main
Eric Amodio il y a 1 an
Parent
révision
84d1ede76c
3 fichiers modifiés avec 24 ajouts et 2 suppressions
  1. +1
    -1
      src/views/nodes/repositoriesNode.ts
  2. +13
    -1
      src/views/nodes/workspaceNode.ts
  3. +10
    -0
      src/views/nodes/workspacesViewNode.ts

+ 1
- 1
src/views/nodes/repositoriesNode.ts Voir le fichier

@ -168,6 +168,6 @@ export class RepositoriesNode extends SubscribeableViewNode
@debug()
private onRepositoriesChanged(_e: RepositoriesChangeEvent) {
void this.triggerChange();
void this.triggerChange(true);
}
}

+ 13
- 1
src/views/nodes/workspaceNode.ts Voir le fichier

@ -30,7 +30,9 @@ export class WorkspaceNode extends ViewNode {
return this.workspace.name;
}
private _children: ViewNode[] | undefined;
private _children:
| (CommandMessageNode | MessageNode | RepositoryNode | WorkspaceMissingRepositoryNode)[]
| undefined;
async getChildren(): Promise<ViewNode[]> {
if (this._children == null) {
@ -130,6 +132,16 @@ export class WorkspaceNode extends ViewNode {
}
override refresh() {
if (this._children == null) return;
if (this._children.length) {
for (const child of this._children) {
if ('dispose' in child) {
child.dispose();
}
}
}
this._children = undefined;
}
}

+ 10
- 0
src/views/nodes/workspacesViewNode.ts Voir le fichier

@ -55,6 +55,16 @@ export class WorkspacesViewNode extends ViewNode {
@gate()
@debug()
override refresh() {
if (this._children == null) return;
if (this._children.length) {
for (const child of this._children) {
if ('dispose' in child) {
child.dispose();
}
}
}
this._children = undefined;
}
}

Chargement…
Annuler
Enregistrer