From f639b0ffbb837975909b7f036720817610b2dd8b Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 23 Nov 2024 12:27:38 +0100 Subject: [PATCH] fix stop virtual device. --- wigglecam/services/backends/cameras/virtualcamera.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wigglecam/services/backends/cameras/virtualcamera.py b/wigglecam/services/backends/cameras/virtualcamera.py index dd3a61c..7e352f0 100644 --- a/wigglecam/services/backends/cameras/virtualcamera.py +++ b/wigglecam/services/backends/cameras/virtualcamera.py @@ -54,7 +54,9 @@ def start(self, nominal_framerate: int = None): def stop(self): super().stop() - self._producer_thread.stop() + if self._producer_thread and self._producer_thread.is_alive(): + self._producer_thread.stop() + self._producer_thread.join() def camera_alive(self) -> bool: super_alive = super().camera_alive()