Skip to content

Commit

Permalink
Fixup2
Browse files Browse the repository at this point in the history
  • Loading branch information
santigimeno committed Sep 19, 2022
1 parent ec1c853 commit 6eacee5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/env.cc
Expand Up @@ -1048,11 +1048,14 @@ void Environment::RunAndClearInterrupts() {
void Environment::RunAndClearNativeImmediates(bool only_refed) {
TRACE_EVENT0(TRACING_CATEGORY_NODE1(environment),
"RunAndClearNativeImmediates");
if (isolate_->IsExecutionTerminating())
return;

HandleScope handle_scope(isolate_);
InternalCallbackScope cb_scope(this, Object::New(isolate_), { 0, 0 });
// In case the Isolate is no longer accessible just use an empty Local. This
// is not an issue for InternalCallbackScope as this case is already handled
// in its constructor but we avoid calls into v8 which can crash the process
// in debug builds.
Local<Object> obj = can_call_into_js() ? Object::New(isolate_) : Local<Object>();
InternalCallbackScope cb_scope(this, obj, { 0, 0 });

size_t ref_count = 0;

Expand Down

0 comments on commit 6eacee5

Please sign in to comment.