Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix accessibilityComponentType crash #49

Merged

Conversation

haitaoli
Copy link

Motivation

DynamicFromMap internally uses SimplePool object to recycle dynamic prop objects. But the pool is not multi-thread safe. Before accessibilityComponentType prop was added, the only dynamic props are size props such as left, paddingVertical, marginTop and so on. These props are only accessed from the layout thread so the pool works fine. The new accessibilityComponentType prop is accessed from UI thread, so now two threads can access the pool object and caused random errors. This PR make the pool object thread local to avoid synchronization. After this change there are two pool objects created in the process.

Test Plan

Tested RNTester app and didn't notice anything.

Code Review

@lelandrichardson @gpeal

Copy link
Collaborator

@gpeal gpeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Way to track this down!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants