Closed
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