change to 'static' list so the listener change lock is released early
@@ -222,7 +222,9 @@ class BaseTransport(stomp.listener.Publisher):
self.set_connected(False)
with self.__listeners_change_condition:
- for listener in self.listeners.values():
+ listeners = list(self.listeners.values())
+
+ for listener in listeners:
if not listener:
continue
@@ -254,7 +256,9 @@ class BaseTransport(stomp.listener.Publisher):
:param Frame frame: the Frame object to transmit
"""
with self.__listeners_change_condition:
- for listener in self.listeners.values():
+ listeners = list(self.listeners.values())
+
+ for listener in listeners:
if not listener:
continue
try:
