From 789879f3df60dc1e000124fdeb09b105c058656e Mon Sep 17 00:00:00 2001 From: lorow Date: Thu, 16 Jun 2022 13:35:59 +0200 Subject: [PATCH] Add cleaning up the stream after cancellation_event was sent --- RANSACApp/camera.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RANSACApp/camera.py b/RANSACApp/camera.py index ea5ad4c..61cdb72 100644 --- a/RANSACApp/camera.py +++ b/RANSACApp/camera.py @@ -41,6 +41,7 @@ class Camera: while True: if self.cancellation_event.is_set(): print("Exiting capture thread") + self.cleanup_stream() return # If things aren't open, retry until they are. Don't let read requests come in any earlier @@ -113,4 +114,4 @@ class Camera: if qsize > 1: print(f"CAPTURE QUEUE BACKPRESSURE OF {qsize}. CHECK FOR CRASH OR TIMING ISSUES IN ALGORITHM.") self.camera_output_outgoing.put((image, frame_number, fps)) - self.capture_event.clear() \ No newline at end of file + self.capture_event.clear()