Cancel listeners when closing
Signed-off-by: Rahix <rahix@rahix.de>
This commit is contained in:
parent
11babfad9e
commit
c27e889d45
1 changed files with 9 additions and 0 deletions
9
bc.lua
9
bc.lua
|
|
@ -224,6 +224,15 @@ function BaseControl:close()
|
||||||
end
|
end
|
||||||
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()
|
self.network:stop()
|
||||||
setmetatable(self, nil)
|
setmetatable(self, nil)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue