mirror of
https://github.com/EyeTrackVR/EyeTrackVR.git
synced 2025-11-04 14:39:42 +08:00
fix: ensure serial is closed when thread crashed
This commit is contained in:
parent
ca56222445
commit
4def965759
@ -56,9 +56,11 @@ class Camera:
|
|||||||
self.buffer = b''
|
self.buffer = b''
|
||||||
|
|
||||||
self.error_message = "\033[93m[WARN] Capture source {} not found, retrying...\033[0m"
|
self.error_message = "\033[93m[WARN] Capture source {} not found, retrying...\033[0m"
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
if self.serial_connection is not None:
|
if self.serial_connection is not None:
|
||||||
self.serial_connection.close()
|
self.serial_connection.close()
|
||||||
|
|
||||||
def set_output_queue(self, camera_output_outgoing: "queue.Queue"):
|
def set_output_queue(self, camera_output_outgoing: "queue.Queue"):
|
||||||
self.camera_output_outgoing = camera_output_outgoing
|
self.camera_output_outgoing = camera_output_outgoing
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user