Skip to content

Commit

Permalink
src: add HandleScope to fix error
Browse files Browse the repository at this point in the history
Add `HandleError`s to the AsyncScope constructor and destructor in
async_wrap-inl.h to fix "FATAL ERROR" incurring observed while running
test-http2-respond-with-file using the --trace-events-enabled flag.

Fixes: #19921

PR-URL: #19972
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
ryzokuken authored and jasnell committed Apr 16, 2018
1 parent 98008dc commit 80de830
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/async_wrap-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ inline AsyncWrap::AsyncScope::AsyncScope(AsyncWrap* wrap)
Environment* env = wrap->env();
if (env->async_hooks()->fields()[Environment::AsyncHooks::kBefore] == 0)
return;
v8::HandleScope handle_scope(env->isolate());
EmitBefore(env, wrap->get_async_id());
}

inline AsyncWrap::AsyncScope::~AsyncScope() {
Environment* env = wrap_->env();
if (env->async_hooks()->fields()[Environment::AsyncHooks::kAfter] == 0)
return;
v8::HandleScope handle_scope(env->isolate());
EmitAfter(env, wrap_->get_async_id());
}

Expand Down

0 comments on commit 80de830

Please sign in to comment.