-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: fix memory leak in Android The issues link: #35890 Explain Defect since 0.65, when call dispatchViewUpdates, we add judge mNumRootViews>0 <img width="531" alt="image" src="https://user-images.githubusercontent.com/20136688/213394240-4c284df4-27de-494e-8eed-8e5f30796cce.png"> When we call removeRootView, it will decrease the mNumRootViews before dispatchViewUpdates <img width="430" alt="image" src="https://user-images.githubusercontent.com/20136688/213394611-d47ab49f-fc7a-4dd1-9836-fe667d655660.png"> So when we remove the last rootview, it will skip call dispatchViewUpdates and do not remove it, it will cause memory leak Explain Fix We should use the original root view num to judge, we can get it from NativeViewHierarchyManager ## Changelog [ANDROID] [FIXED] - fix memory leak in Android <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> Pull Request resolved: #35889 Reviewed By: christophpurrer Differential Revision: D42636805 Pulled By: sshic fbshipit-source-id: 76845b5c1fbdeaf1ebe990356e82059dc1e5b46e
- Loading branch information
1 parent
9eaf6f5
commit bc766ec
Showing
3 changed files
with
25 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters