fixed accidentally global callback in subscribe_once

This commit is contained in:
Max Cahill 2022-11-08 09:20:37 +11:00
parent 94d9901728
commit c6e6ec858c

View File

@ -98,7 +98,7 @@ end
--subscribe to an event, automatically unsubscribe once called
function pubsub:subscribe_once(event, callback)
local called = false
f = function(...)
local f = function(...)
if not called then
callback(...)
self:unsubscribe(event, f)