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 1657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1668 if (error != NULL) { | 1668 if (error != NULL) { |
1669 Log::PrintErr("VM cleanup failed: %s\n", error); | 1669 Log::PrintErr("VM cleanup failed: %s\n", error); |
1670 free(error); | 1670 free(error); |
1671 } | 1671 } |
1672 if (do_vm_shutdown) { | 1672 if (do_vm_shutdown) { |
1673 EventHandler::Stop(); | 1673 EventHandler::Stop(); |
1674 } | 1674 } |
1675 | 1675 |
1676 // Free copied argument strings if converted. | 1676 // Free copied argument strings if converted. |
1677 if (argv_converted) { | 1677 if (argv_converted) { |
1678 for (int i = 0; i < argc; i++) free(argv[i]); | 1678 for (int i = 0; i < argc; i++) { |
| 1679 free(argv[i]); |
| 1680 } |
1679 } | 1681 } |
1680 | 1682 |
1681 // Free environment if any. | 1683 // Free environment if any. |
1682 if (environment != NULL) { | 1684 if (environment != NULL) { |
1683 for (HashMap::Entry* p = environment->Start(); | 1685 for (HashMap::Entry* p = environment->Start(); |
1684 p != NULL; | 1686 p != NULL; |
1685 p = environment->Next(p)) { | 1687 p = environment->Next(p)) { |
1686 free(p->key); | 1688 free(p->key); |
1687 free(p->value); | 1689 free(p->value); |
1688 } | 1690 } |
1689 delete environment; | 1691 delete environment; |
1690 } | 1692 } |
1691 | 1693 |
1692 Platform::Exit(Process::GlobalExitCode()); | 1694 Platform::Exit(Process::GlobalExitCode()); |
1693 } | 1695 } |
1694 | 1696 |
1695 } // namespace bin | 1697 } // namespace bin |
1696 } // namespace dart | 1698 } // namespace dart |
1697 | 1699 |
1698 int main(int argc, char** argv) { | 1700 int main(int argc, char** argv) { |
1699 dart::bin::main(argc, argv); | 1701 dart::bin::main(argc, argv); |
1700 UNREACHABLE(); | 1702 UNREACHABLE(); |
1701 } | 1703 } |
OLD | NEW |