Ozaki Kiichi wrote:
> Calling timer_stop in timer-callback causes SEGV.
>
> [repro steps]
>
> test.vim:
>
> function! StopTimer1(timer)
> let g:timer2 = timer_start(50, 'StopTimer2')
> " avoid bothersome maxfuncdepth error
> call timer_pause(g:timer1, 1)
> sleep 100m
> endfunction
[complement]
> then vim hangs up and we can't intercept by Ctrl-C.
Sorry, 'hang up' is incorrect. Vim accepts key input and redraws screen,
but we can't leave from normal mode.
> https://gist.github.com/ichizok/d6637a6d368bbf1353a35441c34039a7
This patch changes:
* add 'tr_firing' variable to
Calling timer_stop in timer-callback causes SEGV.
[repro steps]
test.vim:
function! StopTimer1(timer)
let g:timer2 = timer_start(50, 'StopTimer2')
" avoid bothersome maxfuncdepth error
call timer_pause(g:timer1, 1)
sleep 100m
endfunction
function! StopTimer2(timer)
let g:timer3 =
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.
Files: src/ex_cmds2.c, src/testdir/test_timers.vim
*** ../vim-7.4.2303/src/ex_