aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2016-05-28 11:16:03 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2016-06-01 11:09:15 +0200
commitd6d8073939dd3c74358dea19b86d49c9bc212754 (patch)
treedc95368a0accfaebfb3c160edf3840157149dba8 /src/nvim/eval.c
parentc16cb06656393de57760ec0a4442b6e92ffaac6e (diff)
downloadrneovim-d6d8073939dd3c74358dea19b86d49c9bc212754.tar.gz
rneovim-d6d8073939dd3c74358dea19b86d49c9bc212754.tar.bz2
rneovim-d6d8073939dd3c74358dea19b86d49c9bc212754.zip
timers: stop all timers on teardown
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index e6f40a0bb8..92e572db2f 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -16569,7 +16569,7 @@ static void timer_due_cb(TimeWatcher *tw, void *data)
{
timer_T *timer = (timer_T *)data;
if (timer->stopped) {
- return;
+ return;
}
// if repeat was negative repeat forever
if (timer->repeat_count >= 0 && --timer->repeat_count == 0) {
@@ -16609,6 +16609,14 @@ static void timer_free_cb(TimeWatcher *tw, void *data)
xfree(timer);
}
+void timer_teardown(void)
+{
+ timer_T *timer;
+ map_foreach_value(timers, timer, {
+ timer_stop(timer);
+ })
+}
+
/*
* "tolower(string)" function
*/