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/fs_event_wrap.cc | |
parent | 7f09a13bbae62bbd9eb9df10d616974a8ed8c577 (diff) | |
download | android-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/fs_event_wrap.cc')
-rw-r--r-- | src/fs_event_wrap.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc index 5dbc278846..8563b40f36 100644 --- a/src/fs_event_wrap.cc +++ b/src/fs_event_wrap.cc @@ -78,9 +78,6 @@ FSEventWrap::~FSEventWrap() { void FSEventWrap::Initialize(Handle<Object> target, Handle<Value> unused, Handle<Context> context) { - Environment* env = Environment::GetCurrent(context); - HandleScope handle_scope(env->isolate()); - Local<FunctionTemplate> t = FunctionTemplate::New(New); t->InstanceTemplate()->SetInternalFieldCount(1); t->SetClassName(FIXED_ONE_BYTE_STRING(node_isolate, "FSEvent")); @@ -94,6 +91,7 @@ void FSEventWrap::Initialize(Handle<Object> target, void FSEventWrap::New(const FunctionCallbackInfo<Value>& args) { assert(args.IsConstructCall()); + HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); new FSEventWrap(env, args.This()); } |