mirror of
https://github.com/kepler155c/opus
synced 2025-10-21 02:37:48 +00:00
reduce coroutine creation
This commit is contained in:
@@ -108,7 +108,9 @@ function Event.off(h)
|
|||||||
if h and h.event then
|
if h and h.event then
|
||||||
for _,event in pairs(h.event) do
|
for _,event in pairs(h.event) do
|
||||||
local handler = Event.types[event][h.uid]
|
local handler = Event.types[event][h.uid]
|
||||||
handler:terminate()
|
if handler then
|
||||||
|
handler:terminate()
|
||||||
|
end
|
||||||
Event.types[event][h.uid] = nil
|
Event.types[event][h.uid] = nil
|
||||||
end
|
end
|
||||||
elseif h and h.co then
|
elseif h and h.co then
|
||||||
|
Reference in New Issue
Block a user