| Index: test/cctest/test-api.cc
|
| diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
|
| index 282dcf2db58178b38807e592df55761701caab13..4a18906ff53ba0e801a0139ac7a504acd511e44d 100644
|
| --- a/test/cctest/test-api.cc
|
| +++ b/test/cctest/test-api.cc
|
| @@ -11256,12 +11256,15 @@ TEST(RunDefaultAndAnotherIsolate) {
|
| v8::Isolate* isolate = v8::Isolate::New();
|
| CHECK(isolate);
|
| isolate->Enter();
|
| - v8::HandleScope scope_new;
|
| - LocalContext context_new;
|
| -
|
| - // Run something in new isolate.
|
| - CompileRun("var foo = 153;");
|
| - ExpectTrue("function f() { return foo == 153; }; f()");
|
| + { // Need this block because subsequent Exit() will deallocate Heap,
|
| + // so we need all scope objects to be deconstructed when it happens.
|
| + v8::HandleScope scope_new;
|
| + LocalContext context_new;
|
| +
|
| + // Run something in new isolate.
|
| + CompileRun("var foo = 153;");
|
| + ExpectTrue("function f() { return foo == 153; }; f()");
|
| + }
|
| isolate->Exit();
|
|
|
| // This runs automatically in default isolate.
|
|
|