fix: call ret:emit_signal("timeout") instead of args.callback (#3933)
This ensures that the timer gets passed on the first call of callback. fixes: #3904 Signed-off-by: aarondill <aaronsacks2006@gmail.com>
This commit is contained in:
parent
ad0290bc1a
commit
220ae797e9
|
@ -205,12 +205,11 @@ function timer.new(args)
|
|||
end
|
||||
|
||||
if args.callback then
|
||||
if args.call_now then
|
||||
args.callback()
|
||||
end
|
||||
ret:connect_signal("timeout", args.callback)
|
||||
end
|
||||
|
||||
if args.call_now then
|
||||
ret:emit_signal("timeout")
|
||||
end
|
||||
if args.single_shot then
|
||||
ret:connect_signal("timeout", function() ret:stop() end)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue