mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
cc50879f55
Summary: After D19565499, the `LongLivedObjectCollection` will be cleared on the JS thread when the jsi::Runtime is deleted. This diff makes it so that we never hold strong references to `CallbackWrapper`s in our Android TurboModules infra. Therefore, we can leverage the changes in D19565499 to ensure that our `jsi::Function`s are deleted before the `jsi::Runtime`. ## Caveat If you delete a TurboModule by itself, it's jsi::Functions that haven't been invoked won't be released. This is also the case for iOS. I plan to fix this for both iOS and Android at a later point in time. Changelog: [Android][Fixed] - Refactor jsi::Function cleanup in TurboModules Reviewed By: mdvacca Differential Revision: D19589151 fbshipit-source-id: efa3cc6c83634014159ac7500dcf6bef9c925762