diff --git a/.changeset/weak-fishes-wait.md b/.changeset/weak-fishes-wait.md new file mode 100644 index 000000000..a2d8e1a24 --- /dev/null +++ b/.changeset/weak-fishes-wait.md @@ -0,0 +1,5 @@ +--- +"solid-js": patch +--- + +fix missing disposal of nested transition nodes diff --git a/packages/solid/src/reactive/signal.ts b/packages/solid/src/reactive/signal.ts index b732d6609..7246fefb4 100644 --- a/packages/solid/src/reactive/signal.ts +++ b/packages/solid/src/reactive/signal.ts @@ -1654,12 +1654,12 @@ function cleanNode(node: Owner) { } } + if ((node as Memo).tOwned) { + for (i = (node as Memo).tOwned!.length - 1; i >= 0; i--) + cleanNode((node as Memo).tOwned![i]); + delete (node as Memo).tOwned; + } if (Transition && Transition.running && (node as Memo).pure) { - if ((node as Memo).tOwned) { - for (i = (node as Memo).tOwned!.length - 1; i >= 0; i--) - cleanNode((node as Memo).tOwned![i]); - delete (node as Memo).tOwned; - } reset(node as Computation, true); } else if (node.owned) { for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);