mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-05-08 13:56:09 +02:00
app_manager: Fix a crash in unregister_handler
This fixes a regression introduced by commit d3f8f4eb.
("RyuApp: delete a key without handlers when unregistering a handler")
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
5be7310ce2
commit
ed25eefa84
@ -178,8 +178,8 @@ class RyuApp(object):
|
||||
def unregister_handler(self, ev_cls, handler):
|
||||
assert callable(handler)
|
||||
self.event_handlers[ev_cls].remove(handler)
|
||||
if not event_handlers[ev_cls]:
|
||||
del event_handlers[ev_cls]
|
||||
if not self.event_handlers[ev_cls]:
|
||||
del self.event_handlers[ev_cls]
|
||||
|
||||
def register_observer(self, ev_cls, name, states=None):
|
||||
states = states or set()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user