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:
James McCoy 2017-04-06 08:56:53 -04:00
parent 0f99645b8f
commit 9edbeec077
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB
2 changed files with 31 additions and 1 deletions

View File

@ -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

View File

@ -109,7 +109,7 @@ static const int included_patches[] = {
2335,
2334,
2333,
// 2332 NA
2332,
2331,
2330,
2329,