Close OpenCV camera cleanly
This commit is contained in:
parent
7fb4417ebe
commit
2019234ad1
1 changed files with 3 additions and 0 deletions
|
|
@ -44,6 +44,9 @@ class OpenCVCamera(Camera):
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def __exit__(self, _exc_type, _exc_value, _traceback):
|
def __exit__(self, _exc_type, _exc_value, _traceback):
|
||||||
|
if self.stream_active:
|
||||||
|
self._capture_enabled = False
|
||||||
|
self._capture_thread.join()
|
||||||
self.cap.release()
|
self.cap.release()
|
||||||
|
|
||||||
@thing_property
|
@thing_property
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue