[FIX] components: avoid leaks when children are outdated/destroyed

Every use case involving some sort of key set on a component would give birth to a leak in an async context:
- If a key of a component changed, the outdated one was never destroyed.
- destroyed component were never removed from their parent's reference map.

This commit solves both issues, that are tightly linked anyway.
This commit is contained in:
Lucas Perais (lpe)
2022-01-11 17:30:56 +01:00
committed by Géry Debongnie
parent 1749bce155
commit a226f92def
7 changed files with 411 additions and 1 deletions
+1
View File
@@ -144,6 +144,7 @@ export class RootFiber extends Fiber {
// Step 2: patching the dom
node.bdom!.patch(this.bdom!, Object.keys(node.children).length > 0);
node.cleanOutdatedChildren();
this.appliedToDom = true;
this.locked = false;