mirror of
https://github.com/neovim/neovim.git
synced 2026-04-28 10:14:06 +00:00
fix(lua): close vim.defer_fn() timer if vim.schedule() failed (#37647)
Problem: Using vim.defer_fn() just before Nvim exit leaks luv handles. Solution: Make vim.schedule() return an error message if scheduling failed. Make vim.defer_fn() close timer if vim.schedule() failed.
This commit is contained in:
@@ -510,8 +510,8 @@ function M.new_session(keep, ...)
|
||||
end
|
||||
if delta > 500 then
|
||||
print(
|
||||
('Nvim session %s took %d milliseconds to exit\n'):format(test_id, delta)
|
||||
.. 'This indicates a likely problem with the test even if it passed!\n'
|
||||
('\nNvim session %s took %d milliseconds to exit\n'):format(test_id, delta)
|
||||
.. 'This indicates a likely problem with the test even if it passed!'
|
||||
)
|
||||
io.stdout:flush()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user