File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1048,11 +1048,16 @@ void Environment::RunAndClearInterrupts() {
10481048void Environment::RunAndClearNativeImmediates (bool only_refed) {
10491049 TRACE_EVENT0 (TRACING_CATEGORY_NODE1 (environment),
10501050 " RunAndClearNativeImmediates" );
1051- if (isolate_->IsExecutionTerminating ())
1052- return ;
10531051
10541052 HandleScope handle_scope (isolate_);
1055- InternalCallbackScope cb_scope (this , Object::New (isolate_), { 0 , 0 });
1053+ // In case the Isolate is no longer accessible just use an empty Local. This
1054+ // is not an issue for InternalCallbackScope as this case is already handled
1055+ // in its constructor but we avoid calls into v8 which can crash the process
1056+ // in debug builds.
1057+ Local<Object> obj = can_call_into_js () ?
1058+ Object::New (isolate_) :
1059+ Local<Object>();
1060+ InternalCallbackScope cb_scope (this , obj, { 0 , 0 });
10561061
10571062 size_t ref_count = 0 ;
10581063
You can’t perform that action at this time.
0 commit comments