aboutsummaryrefslogtreecommitdiff
path: root/src/async-wrap-inl.h
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/async-wrap-inl.h
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/async-wrap-inl.h')
-rw-r--r--src/async-wrap-inl.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/async-wrap-inl.h b/src/async-wrap-inl.h
index b342cabfe6..1de29583b5 100644
--- a/src/async-wrap-inl.h
+++ b/src/async-wrap-inl.h
@@ -191,8 +191,8 @@ inline v8::Handle<v8::Value> AsyncWrap::MakeCallback(
template <typename TYPE>
inline void AsyncWrap::AddAsyncListener(
const v8::FunctionCallbackInfo<v8::Value>& args) {
- Environment* env = Environment::GetCurrent(args.GetIsolate());
v8::HandleScope handle_scope(args.GetIsolate());
+ Environment* env = Environment::GetCurrent(args.GetIsolate());
v8::Local<v8::Object> handle = args.This();
v8::Local<v8::Value> listener = args[0];
@@ -211,8 +211,8 @@ inline void AsyncWrap::AddAsyncListener(
template <typename TYPE>
inline void AsyncWrap::RemoveAsyncListener(
const v8::FunctionCallbackInfo<v8::Value>& args) {
- Environment* env = Environment::GetCurrent(args.GetIsolate());
v8::HandleScope handle_scope(args.GetIsolate());
+ Environment* env = Environment::GetCurrent(args.GetIsolate());
v8::Local<v8::Object> handle = args.This();
v8::Local<v8::Value> listener = args[0];