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

Unified Diff: runtime/bin/main.cc

Issue 10693039: Terminate event handler thread on isolate shutdown. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Adding new file to gyp file Created 8 years, 6 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
« no previous file with comments | « runtime/bin/isolate_data.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/main.cc
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index a34d0660f2775aec9d1dfe6eb2cfcab7df36b64f..7bcd30caa3dee129929b76f5f5abc1237af7a8d9 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -16,6 +16,7 @@
#include "bin/eventhandler.h"
#include "bin/extensions.h"
#include "bin/file.h"
+#include "bin/isolate_data.h"
#include "bin/platform.h"
#include "bin/process.h"
#include "platform/globals.h"
@@ -612,7 +613,7 @@ static bool CreateIsolateAndSetup(const char* script_uri,
return CreateIsolateAndSetupHelper(script_uri,
main,
false, // script_uri already canonical.
- data,
+ new IsolateData(),
error);
}
@@ -692,6 +693,14 @@ static int ErrorExit(const char* format, ...) {
}
+static void ShutdownIsolate(void* callback_data) {
+ IsolateData* isolate_data = reinterpret_cast<IsolateData*>(callback_data);
+ EventHandler* handler = isolate_data->event_handler;
+ if (handler != NULL) handler->Shutdown();
+ delete isolate_data;
+}
+
+
int main(int argc, char** argv) {
char* executable_name;
char* script_name;
@@ -728,7 +737,9 @@ int main(int argc, char** argv) {
Dart_SetVMFlags(vm_options.count(), vm_options.arguments());
// Initialize the Dart VM.
- Dart_Initialize(CreateIsolateAndSetup, NULL, NULL);
+ Dart_Initialize(CreateIsolateAndSetup,
+ NULL,
+ ShutdownIsolate);
original_working_directory = Directory::Current();
@@ -739,7 +750,7 @@ int main(int argc, char** argv) {
if (!CreateIsolateAndSetupHelper(script_name,
"main",
true, // Canonicalize the script name.
- NULL,
+ new IsolateData(),
&error)) {
fprintf(stderr, "%s\n", error);
free(const_cast<char*>(original_working_directory));
« no previous file with comments | « runtime/bin/isolate_data.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698