mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
worker: call CancelTerminateExecution() before exiting Locker
As the comment indicates, this fixes a DCHECK failure, although I don’t quite understand why it is happening in the first place. PR-URL: https://github.com/nodejs/node/pull/33347 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
This commit is contained in:
@@ -260,6 +260,11 @@ void Worker::Run() {
|
||||
|
||||
DeleteFnPtr<Environment, FreeEnvironment> env_;
|
||||
auto cleanup_env = OnScopeLeave([&]() {
|
||||
// TODO(addaleax): This call is harmless but should not be necessary.
|
||||
// Figure out why V8 is raising a DCHECK() here without it
|
||||
// (in test/parallel/test-async-hooks-worker-asyncfn-terminate-4.js).
|
||||
isolate_->CancelTerminateExecution();
|
||||
|
||||
if (!env_) return;
|
||||
env_->set_can_call_into_js(false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user