OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // Generate a snapshot file after loading all the scripts specified on the | 5 // Generate a snapshot file after loading all the scripts specified on the |
6 // command line. | 6 // command line. |
7 | 7 |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1135 } | 1135 } |
1136 | 1136 |
1137 CleanupEntryPointsCollection(entry_points); | 1137 CleanupEntryPointsCollection(entry_points); |
1138 | 1138 |
1139 Dart_EnterIsolate(UriResolverIsolateScope::isolate); | 1139 Dart_EnterIsolate(UriResolverIsolateScope::isolate); |
1140 Dart_ShutdownIsolate(); | 1140 Dart_ShutdownIsolate(); |
1141 } else { | 1141 } else { |
1142 SetupForGenericSnapshotCreation(); | 1142 SetupForGenericSnapshotCreation(); |
1143 CreateAndWriteSnapshot(); | 1143 CreateAndWriteSnapshot(); |
1144 } | 1144 } |
| 1145 error = Dart_Cleanup(); |
| 1146 if (error != NULL) { |
| 1147 Log::PrintErr("VM cleanup failed: %s\n", error); |
| 1148 free(error); |
| 1149 } |
1145 EventHandler::Stop(); | 1150 EventHandler::Stop(); |
1146 return 0; | 1151 return 0; |
1147 } | 1152 } |
1148 | 1153 |
1149 } // namespace bin | 1154 } // namespace bin |
1150 } // namespace dart | 1155 } // namespace dart |
1151 | 1156 |
1152 int main(int argc, char** argv) { | 1157 int main(int argc, char** argv) { |
1153 return dart::bin::main(argc, argv); | 1158 return dart::bin::main(argc, argv); |
1154 } | 1159 } |
OLD | NEW |