Add cleanup function

dev
Rahix 9 years ago committed by Rahix
parent 08ca559ade
commit 4dd809ba03

@ -138,6 +138,8 @@ function bc:init(my_address, local_nouns, local_verbs)
end
-- Change this for deployment VVV
o.modem = modem:init(my_address, modem_listener)
-- Save listener function for deinit
o.modem_cb = modem_listener
-- Init local stuff
o.local_verbs = local_verbs or {}
o.local_nouns = local_nouns or {}
@ -268,4 +270,9 @@ function bc:listen_cancel(n, id)
end
end
-- Deinit
function bc:cleanup()
event.ignore("modem_message", self.modem_cb)
end
return bc

Loading…
Cancel
Save