mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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