Merge pull request #4815 from bfredl/timerfix

timers: racy case found on travis
This commit is contained in:
Björn Linse 2016-05-25 13:56:55 +02:00
commit 2115fcdfd5

View File

@ -16529,6 +16529,9 @@ static void f_timer_stop(typval_T *argvars, typval_T *rettv)
static void timer_due_cb(TimeWatcher *tw, void *data)
{
timer_T *timer = (timer_T *)data;
if (timer->stopped) {
return;
}
// if repeat was negative repeat forever
if (timer->repeat_count >= 0 && --timer->repeat_count == 0) {
timer_stop(timer);