summaryrefslogtreecommitdiff
path: root/src/tcp_wrap.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-11-11 22:02:03 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2013-11-11 10:40:28 +0100
commit09724b311ee44e6c7998c7a5cb39e739609eba66 (patch)
tree7eb3c62b3bca06b7c2da156f6d7a644140377cea /src/tcp_wrap.cc
parent7f09a13bbae62bbd9eb9df10d616974a8ed8c577 (diff)
downloadandroid-node-v8-09724b311ee44e6c7998c7a5cb39e739609eba66.tar.gz
android-node-v8-09724b311ee44e6c7998c7a5cb39e739609eba66.tar.bz2
android-node-v8-09724b311ee44e6c7998c7a5cb39e739609eba66.zip
src: fix Environment::GetCurrent() usage
Create a HandleScope before calling the Environment::GetCurrent() that takes a v8::Isolate* as an argument because it creates a handle with the call to v8::Isolate::CurrentContext().
Diffstat (limited to 'src/tcp_wrap.cc')
-rw-r--r--src/tcp_wrap.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc
index 85fff070a6..be05a294ea 100644
--- a/src/tcp_wrap.cc
+++ b/src/tcp_wrap.cc
@@ -133,8 +133,8 @@ void TCPWrap::New(const FunctionCallbackInfo<Value>& args) {
// Therefore we assert that we are not trying to call this as a
// normal function.
assert(args.IsConstructCall());
- Environment* env = Environment::GetCurrent(args.GetIsolate());
HandleScope handle_scope(args.GetIsolate());
+ Environment* env = Environment::GetCurrent(args.GetIsolate());
TCPWrap* wrap = new TCPWrap(env, args.This());
assert(wrap);
}
@@ -155,8 +155,8 @@ TCPWrap::~TCPWrap() {
void TCPWrap::GetSockName(const FunctionCallbackInfo<Value>& args) {
- Environment* env = Environment::GetCurrent(args.GetIsolate());
HandleScope handle_scope(args.GetIsolate());
+ Environment* env = Environment::GetCurrent(args.GetIsolate());
struct sockaddr_storage address;
TCPWrap* wrap = Unwrap<TCPWrap>(args.This());
@@ -178,8 +178,8 @@ void TCPWrap::GetSockName(const FunctionCallbackInfo<Value>& args) {
void TCPWrap::GetPeerName(const FunctionCallbackInfo<Value>& args) {
- Environment* env = Environment::GetCurrent(args.GetIsolate());
HandleScope handle_scope(args.GetIsolate());
+ Environment* env = Environment::GetCurrent(args.GetIsolate());
struct sockaddr_storage address;
TCPWrap* wrap = Unwrap<TCPWrap>(args.This());
@@ -356,8 +356,8 @@ void TCPWrap::AfterConnect(uv_connect_t* req, int status) {
void TCPWrap::Connect(const FunctionCallbackInfo<Value>& args) {
- Environment* env = Environment::GetCurrent(args.GetIsolate());
HandleScope handle_scope(args.GetIsolate());
+ Environment* env = Environment::GetCurrent(args.GetIsolate());
TCPWrap* wrap = Unwrap<TCPWrap>(args.This());
@@ -388,8 +388,8 @@ void TCPWrap::Connect(const FunctionCallbackInfo<Value>& args) {
void TCPWrap::Connect6(const FunctionCallbackInfo<Value>& args) {
- Environment* env = Environment::GetCurrent(args.GetIsolate());
HandleScope handle_scope(args.GetIsolate());
+ Environment* env = Environment::GetCurrent(args.GetIsolate());
TCPWrap* wrap = Unwrap<TCPWrap>(args.This());