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()