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 = timer_start(50, 'StopTimer3')
  call timer_stop(g:timer1)
endfunction

function! StopTimer3(timer)
  " Do nothing
endfunction

function! TimerStart()
  let g:timer1 = timer_start(50, 'StopTimer1')
  sleep 100m
endfunction
----

vim -Nu NONE -S test.vim

:call TimerStart()

then vim aborts.

[other problem]

Vim hangs up when timer is firing frequently.

test.vim:
----
function! TimerStart()
  call timer_start(0, 'TimerCallback', {'repeat' : -1})
endfunction
function! TimerCallback(...)
endfunction
----

vim -Nu NONE -S test.vim

:call TimerStart()

then vim hangs up and we can't intercept by Ctrl-C.

[patch]

https://gist.github.com/ichizok/d6637a6d368bbf1353a35441c34039a7

* evalfunc.c patch is not concerned with those problems, this modifies 
efficiency of timer_start() slightly.

Thank you.
- Ozaki Kiichi

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui