mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
7a20964e9d
Summary: This diff introduces a new broadcasting event for Bridge that communicates that the bridge is being invalidated. This notification can be used by interested parties as a signal to start tearing down all bridge-dependant processes. The biggest difference between the new event and `RCTBridgeWillInvalidateModulesNotification` is that the latter is being called asynchronously on the JavaScript thread, whereas the new one is being called on whatever thread caused the Bridge invalidation (deallocation) *synchronously*. In most cases that happens on the main thread that allows destroying strictly-main-threaded infra (mostly UI) synchronously and avoids races. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D18050889 fbshipit-source-id: 9364c820ea2b0358edf45f0e2b3e16a13d730a9c