diff --git a/dlclivegui/gui/main_window.py b/dlclivegui/gui/main_window.py index c0c83ee8..0efd744b 100644 --- a/dlclivegui/gui/main_window.py +++ b/dlclivegui/gui/main_window.py @@ -2363,6 +2363,18 @@ def _start_inference(self) -> None: self._update_dlc_controls_enabled() def _stop_inference(self, show_message: bool = True) -> None: + if self._rec_manager.is_active: + answer = QMessageBox.question( + self, + "Stop inference while recording?", + "This will stop any currently running DLC-processor. \n" + "File saving will not be handled via standard stop-recording hook." + "The processor might still save it's own data now, but this will not be paired with the recording.\n\n" + "Stop inference anyway?", + ) + if answer != QMessageBox.Yes: + return + was_active = self._dlc_active self._dlc_active = False self._dlc_initialized = False diff --git a/dlclivegui/services/dlc_processor.py b/dlclivegui/services/dlc_processor.py index 71a278ed..b2cb41f1 100644 --- a/dlclivegui/services/dlc_processor.py +++ b/dlclivegui/services/dlc_processor.py @@ -277,6 +277,7 @@ def shutdown(self) -> None: "Shutdown requested but worker thread is still alive; DLCLive instance may not be fully released." ) return + self._cleanup_processor() self._dlc = None self._initialized = False