File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -122,12 +122,12 @@ def notify_observers(self, notification: INotification) -> None:
122
122
"""
123
123
# Get a reference to the observer list for this notification name
124
124
with self .observerMapLock :
125
- observers = self .observerMap .get (notification .name )
125
+ # Copy observers (observers[:]) from reference array to a working array,
126
+ observers = list (self .observerMap .get (notification .name ) or [])
126
127
127
- # Copy observers (observers[:]) from reference array to a working array,
128
128
# since the reference array may change during the notification loo
129
129
# Safe iteration, create a shallow copy of observers or use an empty list if observers is None or falsy.
130
- for observer in list ( observers or []) :
130
+ for observer in observers :
131
131
# Notify Observers from the working array
132
132
observer .notify_observer (notification )
133
133
You can’t perform that action at this time.
0 commit comments