Index: test/cctest/cctest.cc |
diff --git a/test/cctest/cctest.cc b/test/cctest/cctest.cc |
index 69a040ae6ac4edf22a6d8618fbadbfffb7650164..2c1d438fe559470bc15704baa2a2d35e04594528 100644 |
--- a/test/cctest/cctest.cc |
+++ b/test/cctest/cctest.cc |
@@ -97,7 +97,12 @@ void CcTest::Run() { |
} |
callback_(); |
if (initialize_) { |
- EmptyMessageQueues(isolate_); |
+ if (v8::Locker::IsActive()) { |
+ v8::Locker locker(isolate_); |
+ EmptyMessageQueues(isolate_); |
+ } else { |
+ EmptyMessageQueues(isolate_); |
+ } |
isolate_->Exit(); |
} |
} |