react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Clear out CreateReactInstanceTaskRef early when destroying

Open javache opened this issue 1 year ago • 2 comments

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

javache avatar Sep 17 '24 15:09 javache

This pull request was exported from Phabricator. Differential Revision: D62872625

facebook-github-bot avatar Sep 17 '24 15:09 facebook-github-bot

This pull request was exported from Phabricator. Differential Revision: D62872625

facebook-github-bot avatar Sep 18 '24 11:09 facebook-github-bot

This pull request was exported from Phabricator. Differential Revision: D62872625

facebook-github-bot avatar Sep 19 '24 13:09 facebook-github-bot

This pull request has been merged in facebook/react-native@d8aa664adf41ea8109dc91b7a64ceade15c82fea.

facebook-github-bot avatar Sep 19 '24 14:09 facebook-github-bot

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?

react-native-bot avatar Sep 19 '24 14:09 react-native-bot