| 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_tools_api.h" | 10 #include "include/dart_tools_api.h" |
| (...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1262 delete[] isolate_name; | 1262 delete[] isolate_name; |
| 1263 Log::PrintErr("%s\n", error); | 1263 Log::PrintErr("%s\n", error); |
| 1264 free(error); | 1264 free(error); |
| 1265 error = NULL; | 1265 error = NULL; |
| 1266 Process::TerminateExitCodeHandler(); | 1266 Process::TerminateExitCodeHandler(); |
| 1267 error = Dart_Cleanup(); | 1267 error = Dart_Cleanup(); |
| 1268 if (error != NULL) { | 1268 if (error != NULL) { |
| 1269 Log::PrintErr("VM cleanup failed: %s\n", error); | 1269 Log::PrintErr("VM cleanup failed: %s\n", error); |
| 1270 free(error); | 1270 free(error); |
| 1271 } | 1271 } |
| 1272 Process::ClearAllSignalHandlers(); |
| 1272 EventHandler::Stop(); | 1273 EventHandler::Stop(); |
| 1273 Platform::Exit((exit_code != 0) ? exit_code : kErrorExitCode); | 1274 Platform::Exit((exit_code != 0) ? exit_code : kErrorExitCode); |
| 1274 } | 1275 } |
| 1275 main_isolate = isolate; | 1276 main_isolate = isolate; |
| 1276 delete[] isolate_name; | 1277 delete[] isolate_name; |
| 1277 | 1278 |
| 1278 Dart_EnterIsolate(isolate); | 1279 Dart_EnterIsolate(isolate); |
| 1279 ASSERT(isolate == Dart_CurrentIsolate()); | 1280 ASSERT(isolate == Dart_CurrentIsolate()); |
| 1280 ASSERT(isolate != NULL); | 1281 ASSERT(isolate != NULL); |
| 1281 Dart_Handle result; | 1282 Dart_Handle result; |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1680 } | 1681 } |
| 1681 | 1682 |
| 1682 // Terminate process exit-code handler. | 1683 // Terminate process exit-code handler. |
| 1683 Process::TerminateExitCodeHandler(); | 1684 Process::TerminateExitCodeHandler(); |
| 1684 | 1685 |
| 1685 error = Dart_Cleanup(); | 1686 error = Dart_Cleanup(); |
| 1686 if (error != NULL) { | 1687 if (error != NULL) { |
| 1687 Log::PrintErr("VM cleanup failed: %s\n", error); | 1688 Log::PrintErr("VM cleanup failed: %s\n", error); |
| 1688 free(error); | 1689 free(error); |
| 1689 } | 1690 } |
| 1691 Process::ClearAllSignalHandlers(); |
| 1690 EventHandler::Stop(); | 1692 EventHandler::Stop(); |
| 1691 | 1693 |
| 1692 delete app_snapshot; | 1694 delete app_snapshot; |
| 1693 free(app_script_uri); | 1695 free(app_script_uri); |
| 1694 | 1696 |
| 1695 // Free copied argument strings if converted. | 1697 // Free copied argument strings if converted. |
| 1696 if (argv_converted) { | 1698 if (argv_converted) { |
| 1697 for (int i = 0; i < argc; i++) { | 1699 for (int i = 0; i < argc; i++) { |
| 1698 free(argv[i]); | 1700 free(argv[i]); |
| 1699 } | 1701 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1712 Platform::Exit(Process::GlobalExitCode()); | 1714 Platform::Exit(Process::GlobalExitCode()); |
| 1713 } | 1715 } |
| 1714 | 1716 |
| 1715 } // namespace bin | 1717 } // namespace bin |
| 1716 } // namespace dart | 1718 } // namespace dart |
| 1717 | 1719 |
| 1718 int main(int argc, char** argv) { | 1720 int main(int argc, char** argv) { |
| 1719 dart::bin::main(argc, argv); | 1721 dart::bin::main(argc, argv); |
| 1720 UNREACHABLE(); | 1722 UNREACHABLE(); |
| 1721 } | 1723 } |
| OLD | NEW |