Index: test/cctest/test-regexp.cc |
diff --git a/test/cctest/test-regexp.cc b/test/cctest/test-regexp.cc |
index f311dcc578c0df66a65c409c96772c210203951b..4c05aa59385b26510d87135dd56a66c78accd36f 100644 |
--- a/test/cctest/test-regexp.cc |
+++ b/test/cctest/test-regexp.cc |
@@ -711,17 +711,19 @@ typedef RegExpMacroAssemblerMIPS ArchRegExpMacroAssembler; |
class ContextInitializer { |
public: |
ContextInitializer() |
- : scope_(v8::Isolate::GetCurrent()), |
- env_(v8::Context::New(v8::Isolate::GetCurrent())), |
+ : env_(), |
+ scope_(v8::Isolate::GetCurrent()), |
zone_(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT) { |
+ env_ = v8::Context::New(); |
env_->Enter(); |
} |
~ContextInitializer() { |
env_->Exit(); |
+ env_.Dispose(env_->GetIsolate()); |
} |
private: |
+ v8::Persistent<v8::Context> env_; |
v8::HandleScope scope_; |
- v8::Handle<v8::Context> env_; |
v8::internal::ZoneScope zone_; |
}; |