aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-03-27 19:22:44 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-03-27 19:22:44 -0300
commit3f7011ab9185b4968e89086f77b054161a900beb (patch)
tree5b66b53c5c4ae14e03eb6366ca10ec618c2dfd4d
parente995b2156778fb28f1fbcf29a97d3f7f531e7583 (diff)
downloadrneovim-3f7011ab9185b4968e89086f77b054161a900beb.tar.gz
rneovim-3f7011ab9185b4968e89086f77b054161a900beb.tar.bz2
rneovim-3f7011ab9185b4968e89086f77b054161a900beb.zip
Fix prepare watcher teardown in the event loop
-rw-r--r--src/os/event.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/os/event.c b/src/os/event.c
index ce630d5318..798bf03946 100644
--- a/src/os/event.c
+++ b/src/os/event.c
@@ -65,10 +65,8 @@ bool event_poll(int32_t ms)
input_stop();
if (ms > 0) {
- /* Timer event did not trigger, stop the watcher since we no longer
- * care about it */
+ /* Stop the timer */
uv_timer_stop(&timer);
- uv_prepare_stop(&timer_prepare);
}
return input_ready();
@@ -82,5 +80,6 @@ static void timer_cb(uv_timer_t *handle, int status)
static void timer_prepare_cb(uv_prepare_t *handle, int status)
{
- uv_timer_start(&timer, timer_cb, *(uint32_t *)handle->data, 0);
+ uv_timer_start(&timer, timer_cb, *(uint32_t *)timer_prepare.data, 0);
+ uv_prepare_stop(&timer_prepare);
}