dispatcher: on removeHandle(), remove the groups too if it's empty

This commit is contained in:
Noam Meltzer 2016-04-25 10:18:45 +03:00
parent 4ac8f86156
commit 78d1faa21e

View file

@ -238,6 +238,9 @@ class Dispatcher(object):
""" """
if handler in self.handlers[group]: if handler in self.handlers[group]:
self.handlers[group].remove(handler) self.handlers[group].remove(handler)
if not self.handlers[group]:
del self.handlers[group]
self.groups.remove(group)
def addErrorHandler(self, callback): def addErrorHandler(self, callback):
""" """