reduce coroutine creation

This commit is contained in:
kepler155c@gmail.com 2018-11-22 19:57:00 -05:00
parent d5896ca873
commit 9c43a261a8
1 changed files with 3 additions and 1 deletions

View File

@ -108,7 +108,9 @@ function Event.off(h)
if h and h.event then
for _,event in pairs(h.event) do
local handler = Event.types[event][h.uid]
handler:terminate()
if handler then
handler:terminate()
end
Event.types[event][h.uid] = nil
end
elseif h and h.co then