Skip to content

Commit

Permalink
Clear components in LayoutState.releaseRef()
Browse files Browse the repository at this point in the history
Summary: We should hold onto these until we acquire the LayoutState again, we should just release them when the LayoutState itself is released.

Reviewed By: passy

Differential Revision: D8611627

fbshipit-source-id: 678d98a0f5f869a4efd40511938e9adf36b59792
  • Loading branch information
IanChilds authored and facebook-github-bot committed Jun 25, 2018
1 parent 0f853d0 commit 481e486
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,6 @@ static LayoutState calculate(
component.markLayoutStarted();

layoutState = ComponentsPools.acquireLayoutState(c);
layoutState.clearComponents();
layoutState.mShouldGenerateDiffTree = shouldGenerateDiffTree;
layoutState.mComponentTreeId = componentTreeId;
layoutState.mPreviousLayoutStateId =
Expand Down Expand Up @@ -2090,6 +2089,7 @@ void releaseRef() {
ComponentsPools.release(rect);
}
mComponentKeyToBounds.clear();
mComponents.clear();

for (int i = 0, size = mVisibilityOutputs.size(); i < size; i++) {
ComponentsPools.release(mVisibilityOutputs.get(i));
Expand Down

0 comments on commit 481e486

Please sign in to comment.