Memory Leak in Dialog Management: ReactRootView not removed from View Tree when Dialog is not showing #45080
Labels
Needs: Attention
Issues where the author has responded to feedback.
Needs: Author Feedback
Needs: Repro
This issue could be improved with a clear list of steps to reproduce the issue.
Needs: Triage 🔍
Type: New Architecture
Issues and PRs related to new architecture (Fabric/Turbo Modules)
Description
There is a memory leak in the dialog management code of React Native's new architecture. When the hide() method is called and the dialog is not currently showing, the ReactRootView is not removed from the view tree. This results in the ReactRootView holding a reference to the Activity, causing a memory leak.
Steps to reproduce
React Native Version
0.74.2
Affected Platforms
Runtime - Android
Areas
TurboModule - The New Native Module System
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/react-native-community/reproducer-react-native/tree/main
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: