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

CLLocationManager thread safety #62

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

0xTomDaniel
Copy link

@0xTomDaniel 0xTomDaniel commented Jul 5, 2019

If CLLocationManager should be created on the main thread or problems can occur. Here's the error message that is received when not created on the main thread.

A location manager (0x106634fc0) was created on a dispatch queue executing on a thread other than the main thread. It is the developer's responsibility to ensure that there is a run loop running on the thread on which the location manager object is allocated. In particular, creating location managers in arbitrary dispatch queues (not attached to the main queue) is not supported and will result in callbacks not being received.

A few hours was waisted figuring what was wrong with my app until I discovered this error message in my logs.

This pull request guarantees that CLLocationManager is always created on the main thread.

@0xTomDaniel 0xTomDaniel force-pushed the changed/CLLocationManager-thread branch from 5e21ad1 to 652ea87 Compare July 5, 2019 21:39
@0xTomDaniel
Copy link
Author

@sobri909 Any word on this? There have been many commits since creating this.

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.

1 participant