diff --git a/dlclivegui/gui/main_window.py b/dlclivegui/gui/main_window.py index b59e5bde..8c771d51 100644 --- a/dlclivegui/gui/main_window.py +++ b/dlclivegui/gui/main_window.py @@ -2503,6 +2503,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 the currently running DLC-live custom processor, if any.\n" + "File saving will not be handled via the standard 'recording stopped' event hooks." + "The processor might still save data now, but it 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 e51be750..7cdf9c46 100644 --- a/dlclivegui/services/dlc_processor.py +++ b/dlclivegui/services/dlc_processor.py @@ -283,6 +283,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