Skip to content

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