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 Pedometer being deallocated during query #682

Merged
merged 1 commit into from Jun 20, 2020

Conversation

zacwest
Copy link
Member

@zacwest zacwest commented Jun 20, 2020

This codepath needs to maintain a strong reference to the CMPedometer, or else it deallocates which tears down the Promise prematurely, resulting in the sensors not being created/sent.

This codepath needs to maintain a strong reference to the CMPedometer, or else it deallocates which tears down the Promise prematurely, resulting in the sensors not being created/sent.
@@ -189,11 +189,12 @@ public class Environment {

/// Wrapper around CMPedometeer
public struct Pedometer {
private let underlyingPedometer = CMPedometer()
Copy link
Member Author

Choose a reason for hiding this comment

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

this is exactly the same as the CMMotionActivityManager above, not sure why i didn't do it here

@robbiet480 robbiet480 merged commit f48f24c into master Jun 20, 2020
@robbiet480 robbiet480 deleted the fix-deallocating-pedometer branch June 20, 2020 22:32
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.

None yet

3 participants