Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1050)

Unified Diff: runtime/vm/dart.cc

Issue 18862004: Call shutdown callback before the isolate is destroyed (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/dart.cc
diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc
index 300e5b31e75817fd6e61f19895f7121252861033..e4013740eed50ae16637af0bcb53b85f2d7dd375 100644
--- a/runtime/vm/dart.cc
+++ b/runtime/vm/dart.cc
@@ -210,12 +210,9 @@ RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) {
}
-void Dart::ShutdownIsolate() {
+void Dart::RunShutdownCallback() {
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);
@@ -223,6 +220,13 @@ void Dart::ShutdownIsolate() {
}
+void Dart::ShutdownIsolate() {
+ Isolate* isolate = Isolate::Current();
+ isolate->Shutdown();
+ delete isolate;
+}
+
+
uword Dart::AllocateReadOnlyHandle() {
ASSERT(Isolate::Current() == Dart::vm_isolate());
ASSERT(predefined_handles_ != NULL);

Powered by Google App Engine
This is Rietveld 408576698