| Index: vm/dart.cc
|
| ===================================================================
|
| --- vm/dart.cc (revision 7933)
|
| +++ vm/dart.cc (working copy)
|
| @@ -30,7 +30,8 @@
|
|
|
| // TODO(turnidge): We should add a corresponding Dart::Cleanup.
|
| bool Dart::InitOnce(Dart_IsolateCreateCallback create,
|
| - Dart_IsolateInterruptCallback interrupt) {
|
| + Dart_IsolateInterruptCallback interrupt,
|
| + Dart_IsolateShutdownCallback shutdown) {
|
| // TODO(iposva): Fix race condition here.
|
| if (vm_isolate_ != NULL || !Flags::Initialized()) {
|
| return false;
|
| @@ -59,6 +60,7 @@
|
| Isolate::SetCurrent(NULL); // Unregister the VM isolate from this thread.
|
| Isolate::SetCreateCallback(create);
|
| Isolate::SetInterruptCallback(interrupt);
|
| + Isolate::SetShutdownCallback(shutdown);
|
| return true;
|
| }
|
|
|
| @@ -112,8 +114,14 @@
|
|
|
| void Dart::ShutdownIsolate() {
|
| Isolate* isolate = Isolate::Current();
|
| + void* callback_data = isolate->init_callback_data();
|
| isolate->Shutdown();
|
| delete isolate;
|
| +
|
| + Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback();
|
| + if (callback != NULL) {
|
| + (callback)(callback_data);
|
| + }
|
| }
|
|
|
| } // namespace dart
|
|
|