fix remove_all_events

The threaded event emitter did not remove the wrapper mapping when
remove_all_events were called causing trailing references to objects.
pull/2375/head
Åke Forslund 2019-10-31 09:42:24 +01:00
parent d4a7193fe8
commit 3aea18c7be
1 changed files with 8 additions and 0 deletions

View File

@ -55,3 +55,11 @@ class ThreadedEventEmitter(EventEmitter):
return super().remove_listener(event_name, w[1])
# if no wrapper exists try removing the function
return super().remove_listener(event_name, func)
def remove_all_listeners(self, event_name):
"""Remove all listeners with name.
event_name: identifier of event handler
"""
super().remove_all_listeners(event_name)
self.wrappers.pop(event_name)