Try to fix problem found in the Travis Ci build.

An uv_pipe_t handle for a WStream could be left open for a
particular code path.

Patch by tarruda.
This commit is contained in:
oni-link
2014-11-08 04:03:04 +01:00
parent cf95d27689
commit dba8433723

View File

@@ -230,7 +230,11 @@ static void write_cb(uv_write_t *req, int status)
if (data->wstream->freed && data->wstream->pending_reqs == 0) {
// Last pending write, free the wstream;
free(data->wstream);
if (data->wstream->free_handle) {
uv_close((uv_handle_t *)data->wstream->stream, close_cb);
} else {
free(data->wstream);
}
}
kmp_free(WRequestPool, wrequest_pool, data);