diff --git a/src/env.cc b/src/env.cc index cd7203ffda6e7c..7c1511794bd8e3 100644 --- a/src/env.cc +++ b/src/env.cc @@ -615,6 +615,7 @@ IsolateData::IsolateData(Isolate* isolate, IsolateData::~IsolateData() { if (cpp_heap_ != nullptr) { + v8::Locker locker(isolate_); // The CppHeap must be detached before being terminated. isolate_->DetachCppHeap(); cpp_heap_->Terminate(); diff --git a/test/cctest/test_environment.cc b/test/cctest/test_environment.cc index 14e82cc80ff730..008cda77b650dc 100644 --- a/test/cctest/test_environment.cc +++ b/test/cctest/test_environment.cc @@ -438,6 +438,7 @@ TEST_F(EnvironmentTest, InspectorMultipleEmbeddedEnvironments) { // This test sets a global variable in the child Environment, and reads it // back both through the inspector and inside the child Environment, and // makes sure that those correspond to the value that was originally set. + v8::Locker locker(isolate_); const v8::HandleScope handle_scope(isolate_); const Argv argv; Env env {handle_scope, argv}; @@ -507,6 +508,7 @@ TEST_F(EnvironmentTest, InspectorMultipleEmbeddedEnvironments) { CHECK_NOT_NULL(isolate); { + v8::Locker locker(isolate); v8::Isolate::Scope isolate_scope(isolate); v8::HandleScope handle_scope(isolate); @@ -630,6 +632,7 @@ TEST_F(NodeZeroIsolateTestFixture, CtrlCWithOnlySafeTerminationTest) { // Try creating Context + IsolateData + Environment. { + v8::Locker locker(isolate); v8::Isolate::Scope isolate_scope(isolate); v8::HandleScope handle_scope(isolate); diff --git a/test/cctest/test_platform.cc b/test/cctest/test_platform.cc index fdd51da316ace9..037b6b9cffae85 100644 --- a/test/cctest/test_platform.cc +++ b/test/cctest/test_platform.cc @@ -78,6 +78,7 @@ TEST_F(NodeZeroIsolateTestFixture, IsolatePlatformDelegateTest) { // Try creating Context + IsolateData + Environment { + v8::Locker locker(isolate); v8::Isolate::Scope isolate_scope(isolate); v8::HandleScope handle_scope(isolate);