diff src/ex_cmds2.c @ 9709:cce76af1cc6a v7.4.2130

commit https://github.com/vim/vim/commit/623e263ffb998acacd6fd0de18c44e03af2a47d1 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 30 22:47:56 2016 +0200 patch 7.4.2130 Problem: Pending timers cause false memory leak reports. Solution: Free all timers on exit.
author Christian Brabandt <cb@256bit.org>
date Sat, 30 Jul 2016 23:00:05 +0200
parents 8c2553beff0f
children 4360b2b46125
line wrap: on
line diff
--- 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)