Cancel listeners when closing

Signed-off-by: Rahix <rahix@rahix.de>
This commit is contained in:
rahix 2019-04-17 22:26:03 +02:00
parent 11babfad9e
commit c27e889d45

9
bc.lua
View file

@ -224,6 +224,15 @@ function BaseControl:close()
end
end
-- Cancel all listeners
for noun, listeners in pairs(self.listeners) do
if self.remote_nouns[noun] ~= nil then
for id in pairs(listeners) do
self:cancel(noun, id)
end
end
end
self.network:stop()
setmetatable(self, nil)
end