Permalink
Browse files

Fix a couple more places needing to wrap in Handle<Object>

  • Loading branch information...
1 parent 98978bf commit 9de4704d9bd486c146d43d4514c3e4e1e1279851 @creationix creationix committed Mar 21, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 src/luv_stream.cc
  2. +1 −1 src/luv_tcp.cc
View
@@ -27,7 +27,7 @@ static Value* luv_shutdown(uint32_t argc, Arguments& argv) {
obj->Set("onShutdown", argv[1]->As<Function>());
}
uv_shutdown_t* req = (uv_shutdown_t*)malloc(sizeof(uv_shutdown_t));
- req->data = obj;
+ req->data = new Handle<Object>(obj);
int status = uv_shutdown(req, handle, luv_on_shutdown);
return Number::NewIntegral(status);
}
@@ -133,7 +133,7 @@ static Value* luv_write(uint32_t argc, Arguments& argv) {
// TODO: store callback somehow;
}
uv_write_t* req = (uv_write_t*)malloc(sizeof(uv_write_t));
- req->data = obj;
+ req->data = new Handle<Object>(obj);
int status = uv_write(req, handle, buf, 1, luv_on_write);
return Number::NewIntegral(status);
}
View
@@ -142,7 +142,7 @@ static Value* luv_tcp_connect(uint32_t argc, Arguments& argv) {
}
struct sockaddr_in address = uv_ip4_addr(host, port);
uv_connect_t* req = (uv_connect_t*)malloc(sizeof(uv_connect_t));
- req->data = obj;
+ req->data = new Handle<Object>(obj);
int status = uv_tcp_connect(req, handle, address, luv_on_connect);
return Number::NewIntegral(status);
}

0 comments on commit 9de4704

Please sign in to comment.