react-native
react-native copied to clipboard
Clear out CreateReactInstanceTaskRef early when destroying
Summary:
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]
Differential Revision: D62872625
This pull request was exported from Phabricator. Differential Revision: D62872625
This pull request was exported from Phabricator. Differential Revision: D62872625
This pull request was exported from Phabricator. Differential Revision: D62872625
This pull request has been merged in facebook/react-native@d8aa664adf41ea8109dc91b7a64ceade15c82fea.
This pull request was successfully merged by @javache in d8aa664adf41ea8109dc91b7a64ceade15c82fea
When will my fix make it into a release? | How to file a pick request?