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

Unified Diff: examples/dart/hello_world/hello/main.dart

Issue 996923003: Dart: Better handle leak checks. close() is async. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Fix regexes 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
Index: examples/dart/hello_world/hello/main.dart
diff --git a/examples/dart/hello_world/hello/main.dart b/examples/dart/hello_world/hello/main.dart
index bd896a118a9304bd79d7fd21085ea59be96cab7a..0f828a86a496936f77c3606a1d912bc8416e3ec8 100644
--- a/examples/dart/hello_world/hello/main.dart
+++ b/examples/dart/hello_world/hello/main.dart
@@ -5,6 +5,7 @@
// To run this app:
// mojo_shell mojo:hello
+import 'dart:async';
import 'mojo:application';
import 'mojo:bindings';
import 'mojo:core';
@@ -23,7 +24,12 @@ class Hello extends Application {
// app has a chance to come up. Instead, we wait to close this app until
// the "world" app comes up, does its print, and closes its end of the
// connection.
- c.onError = close;
+ c.onError = closeApplication;
+ }
+
+ Future closeApplication() async {
+ await close();
+ assert(MojoHandle.reportLeakedHandles());
}
}

Powered by Google App Engine
This is Rietveld 408576698