Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1255793005: Fix shutdown failure path (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 6536e08d26540ffeb475b6a4e8127a3b38d596e7..75a5954b613f54faf30d1a2cd8d821f004ce3a7a 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -1364,28 +1364,31 @@ DART_EXPORT Dart_Isolate Dart_CreateIsolate(const char* script_uri,
}
Isolate* isolate = Dart::CreateIsolate(isolate_name, *flags);
free(isolate_name);
- StackZone zone(isolate);
- HANDLESCOPE(isolate);
- // We enter an API scope here as InitializeIsolate could compile some
- // bootstrap library files which call out to a tag handler that may create
- // Api Handles when an error is encountered.
- Dart_EnterScope();
- const Error& error_obj =
- Error::Handle(isolate, Dart::InitializeIsolate(snapshot, callback_data));
- if (error_obj.IsNull()) {
-#if defined(DART_NO_SNAPSHOT)
- if (FLAG_check_function_fingerprints) {
- Library::CheckFunctionFingerprints();
+ {
+ StackZone zone(isolate);
+ HANDLESCOPE(isolate);
+ // We enter an API scope here as InitializeIsolate could compile some
+ // bootstrap library files which call out to a tag handler that may create
+ // Api Handles when an error is encountered.
+ Dart_EnterScope();
+ const Error& error_obj =
+ Error::Handle(isolate,
+ Dart::InitializeIsolate(snapshot, callback_data));
+ if (error_obj.IsNull()) {
+ #if defined(DART_NO_SNAPSHOT)
+ if (FLAG_check_function_fingerprints) {
+ Library::CheckFunctionFingerprints();
+ }
+ #endif // defined(DART_NO_SNAPSHOT).
+ // We exit the API scope entered above.
+ Dart_ExitScope();
+ START_TIMER(isolate, time_total_runtime);
+ return Api::CastIsolate(isolate);
}
-#endif // defined(DART_NO_SNAPSHOT).
+ *error = strdup(error_obj.ToErrorCString());
// We exit the API scope entered above.
Dart_ExitScope();
- START_TIMER(isolate, time_total_runtime);
- return Api::CastIsolate(isolate);
}
- *error = strdup(error_obj.ToErrorCString());
- // We exit the API scope entered above.
- Dart_ExitScope();
Dart::ShutdownIsolate();
return reinterpret_cast<Dart_Isolate>(NULL);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698