mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
Merge pull request #4829 from bfredl/timerclose
timers: stop all timers on teardown
This commit is contained in:
commit
0afe63e925
@ -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
|
||||
*/
|
||||
|
@ -161,6 +161,7 @@ void event_teardown(void)
|
||||
input_stop();
|
||||
channel_teardown();
|
||||
process_teardown(&main_loop);
|
||||
timer_teardown();
|
||||
server_teardown();
|
||||
signal_teardown();
|
||||
terminal_teardown();
|
||||
|
Loading…
Reference in New Issue
Block a user