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

Unified Diff: runtime/bin/main.cc

Issue 1270323002: Revert VM thread cleanup (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 | « runtime/bin/gen_snapshot.cc ('k') | runtime/bin/process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/main.cc
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 06d505675a643166d855d61d6a08b9d702a61412..5c36f41abee04c0ac518f95a8328b615e666fe24 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -108,14 +108,7 @@ static void ErrorExit(int exit_code, const char* format, ...) {
Dart_ExitScope();
Dart_ShutdownIsolate();
- // Terminate process exit-code handler.
- Process::TerminateExitCodeHandler();
-
- char* error = Dart_Cleanup();
- if (error != NULL) {
- Log::PrintErr("VM cleanup failed: %s\n", error);
- free(error);
- }
+ Dart_Cleanup();
exit(exit_code);
}
@@ -631,7 +624,6 @@ static Dart_Isolate CreateIsolateAndSetupHelper(const char* script_uri,
error);
if (isolate == NULL) {
- delete isolate_data;
return NULL;
}
@@ -1037,17 +1029,15 @@ void main(int argc, char** argv) {
}
// Initialize the Dart VM.
- char* error = Dart_Initialize(vm_isolate_snapshot_buffer,
- CreateIsolateAndSetup, NULL, NULL, ShutdownIsolate,
- DartUtils::OpenFile,
- DartUtils::ReadFile,
- DartUtils::WriteFile,
- DartUtils::CloseFile,
- DartUtils::EntropySource);
- if (error != NULL) {
- fprintf(stderr, "VM initialization failed: %s\n", error);
+ if (!Dart_Initialize(vm_isolate_snapshot_buffer,
+ CreateIsolateAndSetup, NULL, NULL, ShutdownIsolate,
+ DartUtils::OpenFile,
+ DartUtils::ReadFile,
+ DartUtils::WriteFile,
+ DartUtils::CloseFile,
+ DartUtils::EntropySource)) {
+ fprintf(stderr, "%s", "VM initialization failed\n");
fflush(stderr);
- free(error);
exit(kErrorExitCode);
}
@@ -1058,6 +1048,7 @@ void main(int argc, char** argv) {
// Call CreateIsolateAndSetup which creates an isolate and loads up
// the specified application script.
+ char* error = NULL;
int exit_code = 0;
char* isolate_name = BuildIsolateName(script_name, "main");
Dart_Isolate isolate = CreateIsolateAndSetupHelper(script_name,
@@ -1070,14 +1061,7 @@ void main(int argc, char** argv) {
if (isolate == NULL) {
Log::PrintErr("%s\n", error);
free(error);
- error = NULL;
delete [] isolate_name;
- Process::TerminateExitCodeHandler();
- error = Dart_Cleanup();
- if (error != NULL) {
- Log::PrintErr("VM cleanup failed: %s\n", error);
- free(error);
- }
exit((exit_code != 0) ? exit_code : kErrorExitCode);
}
delete [] isolate_name;
@@ -1181,11 +1165,7 @@ void main(int argc, char** argv) {
// Terminate process exit-code handler.
Process::TerminateExitCodeHandler();
- error = Dart_Cleanup();
- if (error != NULL) {
- Log::PrintErr("VM cleanup failed: %s\n", error);
- free(error);
- }
+ Dart_Cleanup();
// Free copied argument strings if converted.
if (argv_converted) {
« no previous file with comments | « runtime/bin/gen_snapshot.cc ('k') | runtime/bin/process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698