Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clear out CreateReactInstanceTaskRef early when destroying (#46544)
Summary: Pull Request resolved: #46544 Experiments with `completeReactInstanceCreationOnBgThreadOnAndroid` have shown a native crash in this code path, but it also existed previously. I believe this is due to the ordering of ReactInstance teardown: we first destroy the ReactInstance, and only then destroy the reference to it in mCreateReactInstanceTaskRef. When using the immediate executor and completeReactInstanceCreationOnBgThreadOnAndroid, we read the react instance from the task, which may no longer be valid at this point. Resetting the task at the earliest point should mitigate the issue. Changelog: [Internal] Reviewed By: markv Differential Revision: D62872625 fbshipit-source-id: 5aaccd53433ca806d2b93f7e3dd2bcf9bf8c09a8
- Loading branch information