mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 14:38:32 +00:00
Fix prepare watcher teardown in the event loop
This commit is contained in:
@@ -65,10 +65,8 @@ bool event_poll(int32_t ms)
|
|||||||
input_stop();
|
input_stop();
|
||||||
|
|
||||||
if (ms > 0) {
|
if (ms > 0) {
|
||||||
/* Timer event did not trigger, stop the watcher since we no longer
|
/* Stop the timer */
|
||||||
* care about it */
|
|
||||||
uv_timer_stop(&timer);
|
uv_timer_stop(&timer);
|
||||||
uv_prepare_stop(&timer_prepare);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return input_ready();
|
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)
|
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);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user