unix: fix fs_event refcount bug on darwin

The event loop got unref'd twice when the handle was closed.
This commit is contained in:
Ben Noordhuis 2012-02-29 15:55:05 +01:00
parent 44c9f63cb1
commit b3fe183040

View File

@ -68,11 +68,12 @@ static void uv__fs_event(EV_P_ ev_io* w, int revents) {
handle->cb(handle, NULL, events, 0);
uv__fs_event_stop(handle);
if (handle->fd == -1)
return;
/* File watcher operates in one-shot mode, re-arm it. */
if (handle->fd != -1)
uv__fs_event_start(handle);
uv__fs_event_stop(handle);
uv__fs_event_start(handle);
}