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

Unified Diff: mojo/dart/embedder/dart_controller.cc

Issue 996923003: Dart: Better handle leak checks. close() is async. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Merge Created 5 years, 9 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 | « mojo/dart/apptest/apptest/apptest.dart ('k') | mojo/dart/embedder/isolate_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/dart/embedder/dart_controller.cc
diff --git a/mojo/dart/embedder/dart_controller.cc b/mojo/dart/embedder/dart_controller.cc
index 03bd10f67271fa7c95e1bd4761507eb38e776d9a..91775a0c6ea63a05e429e289cbaa514103ca0ec6 100644
--- a/mojo/dart/embedder/dart_controller.cc
+++ b/mojo/dart/embedder/dart_controller.cc
@@ -13,6 +13,7 @@
#include "mojo/dart/embedder/builtin.h"
#include "mojo/dart/embedder/dart_controller.h"
#include "mojo/dart/embedder/isolate_data.h"
+#include "mojo/public/c/system/core.h"
namespace mojo {
namespace dart {
@@ -429,6 +430,13 @@ static void UnhandledExceptionCallback(Dart_Handle error) {
// for clients if we pass any error string here instead.
isolate_data->callbacks.exception.Run(error);
}
+
+ // Close handles generated by the isolate.
+ std::set<MojoHandle>& handles = isolate_data->unclosed_handles;
+ for (auto it = handles.begin(); it != handles.end(); ++it) {
+ MojoClose((*it));
+ }
+ handles.clear();
}
« no previous file with comments | « mojo/dart/apptest/apptest/apptest.dart ('k') | mojo/dart/embedder/isolate_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698