From c7394802bdc02a7e7c9b62163df10ebb70ddf57f Mon Sep 17 00:00:00 2001 From: Deepskyhunter <48083317+Deepskyhunter@users.noreply.github.com> Date: Thu, 7 Jul 2022 17:20:08 +0800 Subject: [PATCH] aqctl_moninj_proxy: clear listeners on disconnect --- artiq/frontend/aqctl_moninj_proxy.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/artiq/frontend/aqctl_moninj_proxy.py b/artiq/frontend/aqctl_moninj_proxy.py index 8ce6581a9..fcf9e259d 100755 --- a/artiq/frontend/aqctl_moninj_proxy.py +++ b/artiq/frontend/aqctl_moninj_proxy.py @@ -116,6 +116,9 @@ class MonitorMux: else: raise ValueError + def disconnect_cb(self): + self.listeners.clear() + class ProxyConnection: def __init__(self, monitor_mux, reader, writer): @@ -203,7 +206,9 @@ def main(): signal_handler.setup() try: monitor_mux = MonitorMux() - comm_moninj = CommMonInj(monitor_mux.monitor_cb, monitor_mux.injection_status_cb) + comm_moninj = CommMonInj(monitor_mux.monitor_cb, + monitor_mux.injection_status_cb, + monitor_mux.disconnect_cb) monitor_mux.comm_moninj = comm_moninj loop.run_until_complete(comm_moninj.connect(args.core_addr)) try: