From 3cb5e727a1da83803d5d79a115cb95ab9379e2e2 Mon Sep 17 00:00:00 2001 From: Prohurtz <48768484+RedHawk989@users.noreply.github.com> Date: Thu, 4 Jul 2024 21:21:10 -0500 Subject: [PATCH] fix: add try to cam release --- EyeTrackApp/camera.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/EyeTrackApp/camera.py b/EyeTrackApp/camera.py index 6bfa5a7..a457597 100644 --- a/EyeTrackApp/camera.py +++ b/EyeTrackApp/camera.py @@ -129,7 +129,10 @@ class Camera: print(f"{Fore.CYAN}[INFO] Exiting Capture thread{Fore.RESET}") # openCV won't switch to a new source if provided with one # so, we have to manually release the camera on exit - self.cv2_camera.release() + try: + self.cv2_camera.release() + except: + pass return should_push = True # If things aren't open, retry until they are. Don't let read requests come in any earlier