Close OpenCV camera cleanly

This commit is contained in:
Richard Bowman 2024-08-09 02:50:39 +01:00
parent 7fb4417ebe
commit 2019234ad1

View file

@ -44,6 +44,9 @@ class OpenCVCamera(Camera):
return self
def __exit__(self, _exc_type, _exc_value, _traceback):
if self.stream_active:
self._capture_enabled = False
self._capture_thread.join()
self.cap.release()
@thing_property