Files
react-native/ReactCommon
Ramanpreet NaraandFacebook GitHub Bot d6fef50bd9 Make __turboModuleProxy retain TurboModuleManager
Summary:
RCTTurboModuleManager can be deallocated on a non-JS thread. This could create a race, when `__turboModuleProxy` is called from JS after cleanup has started. It's safer to just let `__turboModuleProxy` retain the TurboModuleManager.

In the future, we should clarify the ownership model for TurboModuleManager, so that we can explicitly delete RCTTurboModuleManager by nullifying a singular reference to it. For now, I'd like to land this change to potentially fix/narrow down the cause of T74825789.

Right now, a few objects can own RCTTurboModuleManager:
- FBReactModule, as the creator of RCTTurboModuleManager
- RCTCxxBridge, as an `id<RCTTurboModuleRegistry>` to supplement NativeModule lookup
- NativeModules that need to look up other NativeModules
- **New:** `__turboModuleProxy`

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D23608187

fbshipit-source-id: c14c8157e7670a8e32b7cd0d4c1ad5e2ab6d8abe
2020-09-09 17:30:40 -07:00
..
2020-05-15 21:55:52 -07:00
2020-05-15 21:55:52 -07:00
2020-08-03 09:28:21 -07:00