vim-patch:7.4.2304

Problem:    In a timer callback the timer itself can't be found or stopped.
            (Thinca)
Solution:   Do not remove the timer from the list, remember whether it was
            freed.

417ccd7138
This commit is contained in:
James McCoy 2017-04-06 08:55:51 -04:00
parent 6a6bbbc6d8
commit 0f99645b8f
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB
2 changed files with 16 additions and 1 deletions

View File

@ -125,4 +125,19 @@ func Test_paused()
endif
endfunc
func StopMyself(timer)
let g:called += 1
if g:called == 2
call timer_stop(a:timer)
endif
endfunc
func Test_delete_myself()
let g:called = 0
let t = timer_start(10, 'StopMyself', {'repeat': -1})
call WaitFor('g:called == 2')
call assert_equal(2, g:called)
call assert_equal([], timer_info(t))
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@ -137,7 +137,7 @@ static const int included_patches[] = {
2307,
2306,
2305,
// 2304 NA
2304,
2303,
// 2302 NA
// 2301 NA