mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:7.4.2332
Problem: Crash when stop_timer() is called in a callback of a callback.
Vim hangs when the timer callback uses too much time.
Solution: Set tr_id to -1 when a timer is to be deleted. Don't keep calling
callbacks forever. (Ozaki Kiichi)
75537a93e9
This commit is contained in:
parent
0f99645b8f
commit
9edbeec077
@ -140,4 +140,34 @@ func Test_delete_myself()
|
||||
call assert_equal([], timer_info(t))
|
||||
endfunc
|
||||
|
||||
func StopTimer1(timer)
|
||||
let g:timer2 = timer_start(10, 'StopTimer2')
|
||||
" avoid maxfuncdepth error
|
||||
call timer_pause(g:timer1, 1)
|
||||
sleep 40m
|
||||
endfunc
|
||||
|
||||
func StopTimer2(timer)
|
||||
call timer_stop(g:timer1)
|
||||
endfunc
|
||||
|
||||
func Test_stop_in_callback()
|
||||
let g:timer1 = timer_start(10, 'StopTimer1')
|
||||
sleep 40m
|
||||
endfunc
|
||||
|
||||
func StopTimerAll(timer)
|
||||
call timer_stopall()
|
||||
endfunc
|
||||
|
||||
func Test_stop_all_in_callback()
|
||||
let g:timer1 = timer_start(10, 'StopTimerAll')
|
||||
let info = timer_info()
|
||||
call assert_equal(1, len(info))
|
||||
sleep 40m
|
||||
let info = timer_info()
|
||||
call assert_equal(0, len(info))
|
||||
endfunc
|
||||
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
@ -109,7 +109,7 @@ static const int included_patches[] = {
|
||||
2335,
|
||||
2334,
|
||||
2333,
|
||||
// 2332 NA
|
||||
2332,
|
||||
2331,
|
||||
2330,
|
||||
2329,
|
||||
|
Loading…
Reference in New Issue
Block a user