Skip to content

Commit

Permalink
src: don't run tasks on isolate termination
Browse files Browse the repository at this point in the history
Fixes: #45419
PR-URL: #45444
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
santigimeno authored and danielleadams committed Jan 4, 2023
1 parent eb4ba32 commit 8874833
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_platform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ int NodePlatform::NumberOfWorkerThreads() {
}

void PerIsolatePlatformData::RunForegroundTask(std::unique_ptr<Task> task) {
if (isolate_->IsExecutionTerminating()) return task->Run();
if (isolate_->IsExecutionTerminating()) return;
DebugSealHandleScope scope(isolate_);
Environment* env = Environment::GetCurrent(isolate_);
if (env != nullptr) {
Expand Down

0 comments on commit 8874833

Please sign in to comment.