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,9 +243,10 @@ class StreamingCamera(BaseCamera):
def stop_preview(self) -> bool:
"""Stop the on board GPU camera preview."""
self.camera.stop_preview()
self.state['preview_active'] = False
time.sleep(0.2)
with self.lock:
self.camera.stop_preview()
self.state['preview_active'] = False
time.sleep(0.2)
return True
def start_recording(