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
Member

@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.

@mattleibow
Copy link
Member

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

@mattleibow mattleibow merged commit c6317a8 into main May 17, 2022
@mattleibow mattleibow deleted the one_attach_at_a_time branch May 17, 2022 20:39
@mattleibow mattleibow added this to the 6.0.300-servicing milestone May 17, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants