mirror of
https://github.com/neovim/neovim.git
synced 2026-02-19 09:58:32 +00:00
fix: wait() checks condition twice on each interval (#37837)
Problem: wait() checks condition twice on each interval.
Solution: Don't schedule the due callback. Also fix memory leak when
Nvim exits while waiting.
No test that the condition isn't checked twice, as testing for that can
be flaky when there are libuv events from other sources.
This commit is contained in:
@@ -78,4 +78,15 @@ describe('wait()', function()
|
||||
eq('Vim:E475: Invalid value for argument 3', pcall_err(call, 'wait', 0, 1, 0))
|
||||
eq('Vim:E475: Invalid value for argument 3', pcall_err(call, 'wait', 0, 1, ''))
|
||||
end)
|
||||
|
||||
it('does not leak when Nvim exits while waiting', function()
|
||||
n.expect_exit(
|
||||
500,
|
||||
source,
|
||||
[[
|
||||
call timer_start(10, {-> execute('qall!')})
|
||||
call wait(10000, 0)
|
||||
]]
|
||||
)
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user