-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
Platform: AndroidThis issue is specific to AndroidThis issue is specific to AndroidRepro providedA reproduction with a snack or repo is providedA reproduction with a snack or repo is provided
Description
Description
Placing a GestureDetector on a screen and interacting with the GestureDetector, such as pinching or panning, causes the entire ScreenStackFragment to leak on Android when combined with Expo Router (not tested iOS yet).
This is particularly an issue if the screen contains heavy objects such as Bitmaps, as these are failing to be garbage collected as well.
Steps to reproduce
Minimum example repo available here: https://github.com/chairly89/rn-gesture-detector-memory-leak
- Open the app and navigate to the second screen using the button in the center of the screen
- Attempt to pinch or pan on this view (this won't do anything, as no implementation has been added)
- Use the back button to go back to the first screen.
- Open the Android Studio Profiler and there will be a ScreenStackFragment that has not been dereferences and can't be garbage collected.
A link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.
https://github.com/chairly89/rn-gesture-detector-memory-leak
Gesture Handler version
2.28.0
React Native version
0.81.5
Platforms
Android
JavaScript runtime
Hermes
Workflow
Using Expo Prebuild or an Expo development build
Architecture
New Architecture (Fabric)
Build type
Debug mode
Device
Android emulator
Device model
Pixel 9
Acknowledgements
Yes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Platform: AndroidThis issue is specific to AndroidThis issue is specific to AndroidRepro providedA reproduction with a snack or repo is providedA reproduction with a snack or repo is provided