Mercurial > vim
diff src/structs.h @ 10122:3db463d4df25 v7.4.2332
commit https://github.com/vim/vim/commit/75537a93e985ef32e6c267b06ce93629855dd983
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Sep 5 22:45:28 2016 +0200
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 05 Sep 2016 23:00:07 +0200 |
parents | 58e6dd1d8be3 |
children | 65afd399ffa7 |
line wrap: on
line diff
--- a/src/structs.h +++ b/src/structs.h @@ -3166,12 +3166,13 @@ typedef struct js_reader js_read_T; typedef struct timer_S timer_T; struct timer_S { - int tr_id; + long tr_id; #ifdef FEAT_TIMERS timer_T *tr_next; timer_T *tr_prev; proftime_T tr_due; /* when the callback is to be invoked */ - int tr_paused; /* when TRUE callback is not invoked */ + char tr_firing; /* when TRUE callback is being called */ + char tr_paused; /* when TRUE callback is not invoked */ int tr_repeat; /* number of times to repeat, -1 forever */ long tr_interval; /* msec */ char_u *tr_callback; /* allocated */