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

Unified Diff: lib/src/channel_manager.dart

Issue 1890003002: Fix a race condition. (Closed) Base URL: git@github.com:dart-lang/json_rpc_2.git@master
Patch Set: Created 4 years, 8 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 | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/channel_manager.dart
diff --git a/lib/src/channel_manager.dart b/lib/src/channel_manager.dart
index 35d75a60814bc80197a4c015c7da6593fdd26505..8f66870735eb4fd81e4c23698fc55174e6b3455d 100644
--- a/lib/src/channel_manager.dart
+++ b/lib/src/channel_manager.dart
@@ -56,7 +56,9 @@ class ChannelManager {
_doneCompleter.completeError(error, stackTrace);
_channel.sink.close();
},
- onDone: _doneCompleter.complete,
+ onDone: () {
+ if (!_doneCompleter.isCompleted) _doneCompleter.complete();
+ },
cancelOnError: true);
return done;
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698