OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include <stdlib.h> | 5 #include <stdlib.h> |
6 #include <string.h> | 6 #include <string.h> |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include "include/dart_api.h" | 9 #include "include/dart_api.h" |
10 #include "include/dart_debugger_api.h" | 10 #include "include/dart_debugger_api.h" |
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1091 } | 1091 } |
1092 | 1092 |
1093 Dart_ExitScope(); | 1093 Dart_ExitScope(); |
1094 // Shutdown the isolate. | 1094 // Shutdown the isolate. |
1095 Dart_ShutdownIsolate(); | 1095 Dart_ShutdownIsolate(); |
1096 // Terminate process exit-code handler. | 1096 // Terminate process exit-code handler. |
1097 Process::TerminateExitCodeHandler(); | 1097 Process::TerminateExitCodeHandler(); |
1098 | 1098 |
1099 Dart_Cleanup(); | 1099 Dart_Cleanup(); |
1100 | 1100 |
1101 // Stop event handler. | |
1102 EventHandler::Stop(); | |
kustermann
2015/02/04 20:58:43
I'm actually not 100% sure whether this should be
Søren Gjesse
2015/02/04 21:57:09
It should be safe to post to send ports where the
| |
1103 | |
1101 // Free copied argument strings if converted. | 1104 // Free copied argument strings if converted. |
1102 if (argv_converted) { | 1105 if (argv_converted) { |
1103 for (int i = 0; i < argc; i++) free(argv[i]); | 1106 for (int i = 0; i < argc; i++) free(argv[i]); |
1104 } | 1107 } |
1105 | 1108 |
1106 // Free environment if any. | 1109 // Free environment if any. |
1107 if (environment != NULL) { | 1110 if (environment != NULL) { |
1108 for (HashMap::Entry* p = environment->Start(); | 1111 for (HashMap::Entry* p = environment->Start(); |
1109 p != NULL; | 1112 p != NULL; |
1110 p = environment->Next(p)) { | 1113 p = environment->Next(p)) { |
1111 free(p->key); | 1114 free(p->key); |
1112 free(p->value); | 1115 free(p->value); |
1113 } | 1116 } |
1114 delete environment; | 1117 delete environment; |
1115 } | 1118 } |
1116 | 1119 |
1117 exit(Process::GlobalExitCode()); | 1120 exit(Process::GlobalExitCode()); |
1118 } | 1121 } |
1119 | 1122 |
1120 } // namespace bin | 1123 } // namespace bin |
1121 } // namespace dart | 1124 } // namespace dart |
1122 | 1125 |
1123 int main(int argc, char** argv) { | 1126 int main(int argc, char** argv) { |
1124 dart::bin::main(argc, argv); | 1127 dart::bin::main(argc, argv); |
1125 UNREACHABLE(); | 1128 UNREACHABLE(); |
1126 } | 1129 } |
OLD | NEW |