summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds2.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-07-30 22:47:56 +0200
committerBram Moolenaar <Bram@vim.org>2016-07-30 22:47:56 +0200
commit623e263ffb998acacd6fd0de18c44e03af2a47d1 (patch)
treed9db8377e5c762b97f715af27f115445f3a999c7 /src/ex_cmds2.c
parent3ab14355ed93958433eec58e96ec9bd9a472f2b2 (diff)
patch 7.4.2130v7.4.2130
Problem: Pending timers cause false memory leak reports. Solution: Free all timers on exit.
Diffstat (limited to 'src/ex_cmds2.c')
-rw-r--r--src/ex_cmds2.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index ec9f50a527..2cebbebca8 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -1279,6 +1279,21 @@ set_ref_in_timer(int copyID)
}
return abort;
}
+
+# if defined(EXITFREE) || defined(PROTO)
+ void
+timer_free_all()
+{
+ timer_T *timer;
+
+ while (first_timer != NULL)
+ {
+ timer = first_timer;
+ remove_timer(timer);
+ free_timer(timer);
+ }
+}
+# endif
# endif
#if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME) && defined(FEAT_FLOAT)