-
Notifications
You must be signed in to change notification settings - Fork 25k
Closed
Labels
Needs: Triage 🔍Platform: AndroidAndroid applications.Android applications.StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
Description
Description
When we Integration RN as App SubActivity, if we close the Activity, it will cause memory leak
Explain Defect
since 0.65, when call dispatchViewUpdates, we add judge mNumRootViews>0

When we call removeRootView, it will decrease the mNumRootViews before dispatchViewUpdates

So when we remove the last rootview, it will skip call dispatchViewUpdates and do not remove it, it will cause memory leak
Version
0.65 - ~
Output of npx react-native info
N/A
Steps to reproduce
- Integrate RN as part Activity of APP(do not use RN as MainActivity)
- open RN Activity
- close RN Activity
it will cause memory leak
Snack, code example, screenshot, or link to a repository
code example
https://github.com/feiyin0719/RNMemoryLeakAndroid
Metadata
Metadata
Assignees
Labels
Needs: Triage 🔍Platform: AndroidAndroid applications.Android applications.StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.