Skip to content

Commit fb27fa9

Browse files
Update concore_base.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 0c4ec88 commit fb27fa9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

concore_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ def terminate_zmq(mod):
104104
if mod._cleanup_in_progress:
105105
return # Already cleaning up, prevent reentrant calls
106106

107-
if not mod.zmq_ports:
108-
return # No ports to clean up
107+
if not mod.zmq_ports and (_zmq_context is None or _zmq_context.closed):
108+
return # Nothing to clean up: no ports and no active context
109109

110110
mod._cleanup_in_progress = True
111111
print("\nCleaning up ZMQ resources...")

0 commit comments

Comments
 (0)