Sfoglia il codice sorgente

Fixes node leaks from subscriptions

main
Eric Amodio 1 anno fa
parent
commit
84d1ede76c
3 ha cambiato i file con 24 aggiunte e 2 eliminazioni
  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 Vedi File

@ -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 Vedi File

@ -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 Vedi File

@ -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;
}
}

Caricamento…
Annulla
Salva