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

Unified Diff: lib/src/stream_queue.dart

Issue 1239543004: Fix a bug in StreamQueue.cancel(). (Closed) Base URL: git@github.com:dart-lang/async.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | test/stream_queue_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/stream_queue.dart
diff --git a/lib/src/stream_queue.dart b/lib/src/stream_queue.dart
index 7d78ac593c79181bb504897f8f3b611130a3b48b..be40aa41c9d4543f71d66cc87e55ae2d486953cd 100644
--- a/lib/src/stream_queue.dart
+++ b/lib/src/stream_queue.dart
@@ -236,14 +236,15 @@ class StreamQueue<T> {
if (_isClosed) throw _failClosed();
_isClosed = true;
+ if (_isDone) return new Future.value();
+ if (_subscription == null) _subscription = _sourceStream.listen(null);
+
if (!immediate) {
var request = new _CancelRequest(this);
_addRequest(request);
return request.future;
Lasse Reichstein Nielsen 2015/07/14 07:28:10 That doesn't look right either - you subscribe to
}
- if (_isDone) return new Future.value();
- if (_subscription == null) _subscription = _sourceStream.listen(null);
var future = _subscription.cancel();
_onDone();
return future;
« no previous file with comments | « no previous file | test/stream_queue_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698