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

Request the camera preview on the main ui thread #324

Merged
merged 1 commit into from
Mar 4, 2018

Conversation

HomerSp
Copy link
Contributor

@HomerSp HomerSp commented Sep 7, 2017

Request the camera preview on the main ui thread, in case the camera instance is being closed at the same time.

Since CameraInstance.close and DecoderThread.requestNextPreview are run in different threads we might, randomly, get to a point where open is still set to true in the isOpen call, while it's false when it reaches the validateOpen call.

This PR fixes this by running the requestPreview code on the main ui thread, making it run in the same thread as the close call will be in.

See #272 for more info.

@rkistner rkistner merged commit fa2cd15 into journeyapps:master Mar 4, 2018
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.

2 participants