Skip to content

Commit

Permalink
Merge branch 'v0.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Dec 8, 2011
2 parents f5c2a4a + b89c31b commit 0d8cb08
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/unix/core.c
Expand Up @@ -169,7 +169,15 @@ uv_loop_t* uv_loop_new(void) {
void uv_loop_delete(uv_loop_t* loop) {
uv_ares_destroy(loop, loop->channel);
ev_loop_destroy(loop->ev);
free(loop);

#ifndef NDEBUG
memset(loop, 0, sizeof *loop);
#endif

if (loop == default_loop_ptr)
default_loop_ptr = NULL;
else
free(loop);
}


Expand Down
1 change: 1 addition & 0 deletions src/unix/error.c
Expand Up @@ -82,6 +82,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case EHOSTUNREACH: return UV_EHOSTUNREACH;
case EAI_NONAME: return UV_ENOENT;
case ESRCH: return UV_ESRCH;
case ETIMEDOUT: return UV_ETIMEDOUT;
default: return UV_UNKNOWN;
}

Expand Down
1 change: 0 additions & 1 deletion src/unix/pipe.c
Expand Up @@ -274,5 +274,4 @@ void uv__pipe_accept(EV_P_ ev_io* watcher, int revents) {


void uv_pipe_pending_instances(uv_pipe_t* handle, int count) {
return 0;
}
7 changes: 7 additions & 0 deletions src/unix/stream.c
Expand Up @@ -341,6 +341,13 @@ static void uv__write(uv_stream_t* stream) {
int iovcnt;
ssize_t n;

if (stream->flags & UV_CLOSING) {
/* Handle was closed this tick. We've received a stale
* 'is writable' callback from the event loop, ignore.
*/
return;
}

start:

assert(stream->fd >= 0);
Expand Down

0 comments on commit 0d8cb08

Please sign in to comment.