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

Add a Semaphore for AttachAndRun #7269

Merged
merged 1 commit into from May 17, 2022
Merged

Add a Semaphore for AttachAndRun #7269

merged 1 commit into from May 17, 2022

Conversation

PureWeen
Copy link
Contributor

@PureWeen PureWeen commented May 17, 2022

Description of Change

Android doesn't handle adding and removing views in parallel very well. If a view is removed while a different test triggers a layout then you hit an NRE exception because the FrameLayout iterates all of its children inside OnLayout

I opted for using a SemaphoreSlim here instead of adding Collection because we use this AttachAndRun in a lot of places. We'd probably have to add everything to Collection to make it work that way.

@PureWeen PureWeen requested review from mattleibow and rmarinho May 17, 2022
@mattleibow
Copy link
Contributor

mattleibow commented May 17, 2022

Thanks for catching this one. You have become my Android layout crash knower.

@mattleibow mattleibow merged commit c6317a8 into main May 17, 2022
24 checks passed
@mattleibow mattleibow deleted the one_attach_at_a_time branch May 17, 2022
@mattleibow mattleibow added this to the 6.0.300-servicing milestone May 17, 2022
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.

None yet

2 participants