If you haven't already, check out our contributing guidelines and patch guidelines for information on how to manage patches.
Patch Information
Library Name: react-native-performance
Library Version: 5.1.4
Patch Number: 002
Patch Description: fix-listeners-memory-leak
Full Patch Filename: react-native-performance+5.1.4+002+fix-listeners-memory-leak.patch
Patch Details
Reason for Patch
This patch is part of memory leak audit.
react-native-performance has a memory leak where ReactMarker listeners are not properly removed when the module is destroyed. Additionally, setupListener can be called multiple times when getPackages is called multiple times, causing duplicate listeners.
Changes Made
This PR mainly improves how listeners are added and removed. It also extracts lambdas into constants so that they can be consistently referenced when calling addListener and removeListener, preventing duplicate listeners and ensuring that listeners can be properly removed.
Upstream Status
Upstream PR/Issue: oblador/react-native-performance#118
Related Information
PR Introducing Patch: #72341
Additional Notes
This fix isn’t specific to our HybridApp setup, these issues can occur in any bare React Native or brownfield app on Android.
Checklist
Issue Owner
Current Issue Owner: @
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022001042913833799711
- Upwork Job ID: 2001042913833799711
- Last Price Increase: 2025-12-16
If you haven't already, check out our contributing guidelines and patch guidelines for information on how to manage patches.
Patch Information
Library Name:
react-native-performanceLibrary Version: 5.1.4
Patch Number: 002
Patch Description:
fix-listeners-memory-leakFull Patch Filename:
react-native-performance+5.1.4+002+fix-listeners-memory-leak.patchPatch Details
Reason for Patch
This patch is part of memory leak audit.
react-native-performancehas a memory leak whereReactMarkerlisteners are not properly removed when the module is destroyed. Additionally,setupListenercan be called multiple times whengetPackagesis called multiple times, causing duplicate listeners.Changes Made
This PR mainly improves how listeners are added and removed. It also extracts lambdas into constants so that they can be consistently referenced when calling addListener and removeListener, preventing duplicate listeners and ensuring that listeners can be properly removed.
Upstream Status
Upstream PR/Issue: oblador/react-native-performance#118
Related Information
PR Introducing Patch: #72341
Additional Notes
This fix isn’t specific to our HybridApp setup, these issues can occur in any bare React Native or brownfield app on Android.
Checklist
details.mdfiledetails.mdfileIssue Owner
Current Issue Owner: @Upwork Automation - Do Not Edit