Skip to content

cherry-pick(Reanimated): remove assert in AnimatedSensorModule destructor#8957

Open
MatiPl01 wants to merge 1 commit into4.2-stablefrom
@matipl01/cherry-pick/remove-animated-sensor-assert
Open

cherry-pick(Reanimated): remove assert in AnimatedSensorModule destructor#8957
MatiPl01 wants to merge 1 commit into4.2-stablefrom
@matipl01/cherry-pick/remove-animated-sensor-assert

Conversation

@MatiPl01
Copy link
Member

Cherry-pick of the #8823

## Summary

This PR removes `sensorsIds_.empty()` assert in
`~AnimatedSensorModule()` along with the (now empty) destructor itself
which was supposedly causing a crash when the app is suspended and moved
to the background on iOS.

> If you move the app to the background, iOS suspends it, and after some
time, if you reopen it, the constructor will be called again as the app
resumes. However, the `sensorsIds_` variable is not empty at this point,
so the assert will cause the app to crash. There are methods that will
clear the `sensorsIds_` upon unmounting, so this assert is essentially
causing unnecessary issues.

## Test plan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants