Added a lock to stop_preview for good measure

This commit is contained in:
Richard Bowman 2019-04-08 14:06:14 +01:00
parent ec50d245ab
commit 1cf1e40c54

View file

@ -243,6 +243,7 @@ class StreamingCamera(BaseCamera):
def stop_preview(self) -> bool: def stop_preview(self) -> bool:
"""Stop the on board GPU camera preview.""" """Stop the on board GPU camera preview."""
with self.lock:
self.camera.stop_preview() self.camera.stop_preview()
self.state['preview_active'] = False self.state['preview_active'] = False
time.sleep(0.2) time.sleep(0.2)