Skip to content

Commit

Permalink
Clean up ReactViewGroup child listeners (#46139)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #46139

Potential fix for IndexOutOfBounds crashes in clipping rect logic.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D61615009

fbshipit-source-id: 1208e11286ad2a84c22262462832a66396a1b35b
  • Loading branch information
Thomas Nardone authored and facebook-github-bot committed Aug 21, 2024
1 parent 5f7538c commit 81a41ec
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,13 @@ private void initView() {
}

/* package */ void recycleView() {
// Remove dangling listeners
if (mAllChildren != null && mChildrenLayoutChangeListener != null) {
for (int i = 0; i < mAllChildrenCount; i++) {
mAllChildren[i].removeOnLayoutChangeListener(mChildrenLayoutChangeListener);
}
}

// Set default field values
initView();
mOverflowInset.setEmpty();
Expand Down

0 comments on commit 81a41ec

Please sign in to comment.