From 8caa7a6b2cfaf3649d487dd0a6a4a0348abbf08f Mon Sep 17 00:00:00 2001 From: Mike Langmayr <1809691+mikelangmayr@users.noreply.github.com> Date: Mon, 12 Oct 2026 16:55:04 -0700 Subject: [PATCH] Release the Archon connections when a camera session is destroyed --- python/camera_interface_module.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/python/camera_interface_module.cpp b/python/camera_interface_module.cpp index 06a7fd9..60b986d 100644 --- a/python/camera_interface_module.cpp +++ b/python/camera_interface_module.cpp @@ -107,6 +107,18 @@ namespace { this->interface->configure_frame_outputs(); } + /// Release both Archon sockets; the controller has few and reclaims + /// them only once it notices a peer has gone + ~CameraSession() { + try { + std::string retstring; + this->interface->disconnect_controller("", retstring); + } + // A destructor must not throw, and a failed close is not worth + // taking the process down for + catch (...) {} + } + CameraSession(const CameraSession&) = delete; CameraSession& operator=(const CameraSession&) = delete;