File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1048,11 +1048,14 @@ void Environment::RunAndClearInterrupts() {
1048
1048
void Environment::RunAndClearNativeImmediates (bool only_refed) {
1049
1049
TRACE_EVENT0 (TRACING_CATEGORY_NODE1 (environment),
1050
1050
" RunAndClearNativeImmediates" );
1051
- if (isolate_->IsExecutionTerminating ())
1052
- return ;
1053
1051
1054
1052
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 () ? Object::New (isolate_) : Local<Object>();
1058
+ InternalCallbackScope cb_scope (this , obj, { 0 , 0 });
1056
1059
1057
1060
size_t ref_count = 0 ;
1058
1061
You can’t perform that action at this time.
0 commit comments