From 1c009f2f2c70b512b2145a1bf169e1fbc6ee8a26 Mon Sep 17 00:00:00 2001 From: Avinash Kumar Deepak Date: Sun, 8 Feb 2026 14:43:49 +0530 Subject: [PATCH] Register terminate_zmq with atexit --- concore.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/concore.py b/concore.py index bf804e4e..6bf253e4 100644 --- a/concore.py +++ b/concore.py @@ -1,6 +1,7 @@ import time import logging import os +import atexit from ast import literal_eval import sys import re @@ -104,6 +105,8 @@ def terminate_zmq(): port.context.term() except Exception as e: logging.error(f"Error while terminating ZMQ port {port.address}: {e}") + +atexit.register(terminate_zmq) # --- ZeroMQ Integration End ---