Merge pull request #4829 from bfredl/timerclose

timers: stop all timers on teardown
This commit is contained in:
Björn Linse 2016-06-01 12:07:17 +02:00
commit 0afe63e925
2 changed files with 10 additions and 1 deletions

View File

@ -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
*/

View File

@ -161,6 +161,7 @@ void event_teardown(void)
input_stop();
channel_teardown();
process_teardown(&main_loop);
timer_teardown();
server_teardown();
signal_teardown();
terminal_teardown();