Skip to content

Commit

Permalink
Clear deletions in detachFiber
Browse files Browse the repository at this point in the history
This was added in a later step of the refactor but since `deletions`
array already landed, clearing it should, too.

I think it's unlikely that this causes GC problems but worth
adding anyway.
  • Loading branch information
acdlite committed Dec 7, 2020
1 parent b66ae09 commit 5033654
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/react-reconciler/src/ReactFiberCommitWork.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,7 @@ function detachFiberMutation(fiber: Fiber) {
// and one of its descendants throws while unmounting a passive effect.
fiber.alternate = null;
fiber.child = null;
fiber.deletions = null;
fiber.dependencies = null;
fiber.firstEffect = null;
fiber.lastEffect = null;
Expand Down
1 change: 1 addition & 0 deletions packages/react-reconciler/src/ReactFiberCommitWork.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,7 @@ function detachFiberMutation(fiber: Fiber) {
// and one of its descendants throws while unmounting a passive effect.
fiber.alternate = null;
fiber.child = null;
fiber.deletions = null;
fiber.dependencies = null;
fiber.firstEffect = null;
fiber.lastEffect = null;
Expand Down

0 comments on commit 5033654

Please sign in to comment.