Przeglądaj źródła

Fixes node leaks from subscriptions

main
Eric Amodio 1 rok temu
rodzic
commit
84d1ede76c
3 zmienionych plików z 24 dodań i 2 usunięć
  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 Wyświetl plik

@ -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 Wyświetl plik

@ -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 Wyświetl plik

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

Ładowanie…
Anuluj
Zapisz