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; |