diff options
author | Ujjwal Sharma <usharma1998@gmail.com> | 2018-04-15 12:59:33 +0300 |
---|---|---|
committer | Ujjwal Sharma <usharma1998@gmail.com> | 2018-04-20 08:28:06 +0300 |
commit | e32eddc550eb1aad8fe291a2808c22d1d6142aa5 (patch) | |
tree | 8601a3e63dac6d60d35cee8d47016924e9064d9e /src/async_wrap.cc | |
parent | 76f5b3966bc9bcc275728ce2317183272899272c (diff) |
src: move v8::HandleScope call to Emit
Move v8::HandleScope call to Emit removing it from previous locations
where it was added to avoid crashing (constructor and destructor of
AsyncWrap) for a more general and fool-proof solution.
Ref: https://github.com/nodejs/node/pull/19972#issuecomment-381353894
PR-URL: https://github.com/nodejs/node/pull/20045
Reviewed-By: Yang Guo <yangguo@chromium.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Diffstat (limited to 'src/async_wrap.cc')
-rw-r--r-- | src/async_wrap.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/async_wrap.cc b/src/async_wrap.cc index 5e0543a12d9..06dcbb4fb1d 100644 --- a/src/async_wrap.cc +++ b/src/async_wrap.cc @@ -169,6 +169,7 @@ void Emit(Environment* env, double async_id, AsyncHooks::Fields type, if (async_hooks->fields()[type] == 0) return; + v8::HandleScope handle_scope(env->isolate()); Local<Value> async_id_value = Number::New(env->isolate(), async_id); FatalTryCatch try_catch(env); USE(fn->Call(env->context(), Undefined(env->isolate()), 1, &async_id_value)); |