Index: src/mksnapshot.cc |
diff --git a/src/mksnapshot.cc b/src/mksnapshot.cc |
index b3c6097c859249439185907a9357423f49596c05..7592a8953110683c83c8f7e8942a57cd32555df7 100644 |
--- a/src/mksnapshot.cc |
+++ b/src/mksnapshot.cc |
@@ -328,13 +328,18 @@ int main(int argc, char** argv) { |
} |
#endif |
i::Serializer::Enable(); |
- Persistent<Context> context = v8::Context::New(); |
+ Isolate* isolate = Isolate::GetCurrent(); |
+ Persistent<Context> context; |
+ { |
+ HandleScope handle_scope(isolate); |
+ context.Reset(isolate, Context::New(isolate)); |
+ } |
+ |
if (context.IsEmpty()) { |
fprintf(stderr, |
"\nException thrown while compiling natives - see above.\n\n"); |
exit(1); |
} |
- Isolate* isolate = context->GetIsolate(); |
if (i::FLAG_extra_code != NULL) { |
context->Enter(); |
// Capture 100 frames if anything happens. |