Index: runtime/bin/process.cc |
diff --git a/runtime/bin/process.cc b/runtime/bin/process.cc |
index 672b3e352fb7602f95d1b122dcb3346a11b635f1..ff88201bc12d9cc7a6b67cf5e55b05f839461f2c 100644 |
--- a/runtime/bin/process.cc |
+++ b/runtime/bin/process.cc |
@@ -246,6 +246,11 @@ void FUNCTION_NAME(Process_Exit)(Dart_NativeArguments args) { |
int64_t status = 0; |
// Ignore result if passing invalid argument and just exit 0. |
DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status); |
+ IsolateData* isolate_data = |
+ reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData()); |
+ if (isolate_data->exit_hook() != NULL) { |
+ isolate_data->exit_hook()(status); |
+ } |
Dart_ExitIsolate(); |
Platform::Exit(static_cast<int>(status)); |
} |