diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2013-11-11 22:02:03 +0100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-11-11 10:40:28 +0100 |
commit | 09724b311ee44e6c7998c7a5cb39e739609eba66 (patch) | |
tree | 7eb3c62b3bca06b7c2da156f6d7a644140377cea /src/cares_wrap.cc | |
parent | 7f09a13bbae62bbd9eb9df10d616974a8ed8c577 (diff) | |
download | node-new-09724b311ee44e6c7998c7a5cb39e739609eba66.tar.gz |
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/cares_wrap.cc')
-rw-r--r-- | src/cares_wrap.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index 7758749d02..8145c595a5 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -776,8 +776,8 @@ class GetHostByNameWrap: public QueryWrap { template <class Wrap> static void Query(const FunctionCallbackInfo<Value>& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); HandleScope handle_scope(args.GetIsolate()); + Environment* env = Environment::GetCurrent(args.GetIsolate()); assert(!args.IsConstructCall()); assert(args[0]->IsObject()); @@ -911,8 +911,8 @@ static void IsIP(const FunctionCallbackInfo<Value>& args) { static void GetAddrInfo(const FunctionCallbackInfo<Value>& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); HandleScope handle_scope(args.GetIsolate()); + Environment* env = Environment::GetCurrent(args.GetIsolate()); assert(args[0]->IsObject()); assert(args[1]->IsString()); @@ -958,8 +958,8 @@ static void GetAddrInfo(const FunctionCallbackInfo<Value>& args) { static void GetServers(const FunctionCallbackInfo<Value>& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); HandleScope handle_scope(args.GetIsolate()); + Environment* env = Environment::GetCurrent(args.GetIsolate()); Local<Array> server_array = Array::New(); @@ -988,8 +988,8 @@ static void GetServers(const FunctionCallbackInfo<Value>& args) { static void SetServers(const FunctionCallbackInfo<Value>& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); HandleScope handle_scope(args.GetIsolate()); + Environment* env = Environment::GetCurrent(args.GetIsolate()); assert(args[0]->IsArray()); |