Skip to content

Commit 5e68565

Browse files
committed
Merge pull request flutter#2507 from abarth/less_core
Don't dump core on startup exceptions
2 parents 07d65b7 + 693935c commit 5e68565

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

sky/engine/core/script/dart_controller.cc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ bool DartController::SendStartMessage(Dart_Handle root_library) {
8383
ToDart("_getMainClosure"),
8484
0,
8585
NULL);
86-
DART_CHECK_VALID(main_closure);
86+
if (LogIfError(main_closure))
87+
return true;
8788

8889
// Send the start message containing the entry point by calling
8990
// _startMainIsolate in dart:isolate.
@@ -122,8 +123,9 @@ void DartController::DidLoadSnapshot() {
122123
DartApiScope dart_api_scope;
123124
Dart_Handle library = Dart_RootLibrary();
124125
if (LogIfError(library))
125-
return;
126-
SendStartMessage(library);
126+
exit(1);
127+
if (SendStartMessage(library))
128+
exit(1);
127129
}
128130

129131
void DartController::RunFromPrecompiledSnapshot() {
@@ -143,8 +145,9 @@ void DartController::RunFromSnapshotBuffer(const uint8_t* buffer, size_t size) {
143145
LogIfError(Dart_LoadScriptFromSnapshot(buffer, size));
144146
Dart_Handle library = Dart_RootLibrary();
145147
if (LogIfError(library))
146-
return;
147-
SendStartMessage(library);
148+
exit(1);
149+
if (SendStartMessage(library))
150+
exit(1);
148151
}
149152

150153
void DartController::RunFromLibrary(const std::string& name,

0 commit comments

Comments
 (0)