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

Unified Diff: pkg/barback/lib/src/transformer/base_transform.dart

Issue 560293004: Properly handle barback logs after a transformer's been canceled. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 | « pkg/barback/CHANGELOG.md ('k') | pkg/barback/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/transformer/base_transform.dart
diff --git a/pkg/barback/lib/src/transformer/base_transform.dart b/pkg/barback/lib/src/transformer/base_transform.dart
index f76a6a481f9e3e436a23a6cdee2ff36af3b9a0ca..fe3ab3b6cdd3cf0708a66cc5cef89dbb9a49948b 100644
--- a/pkg/barback/lib/src/transformer/base_transform.dart
+++ b/pkg/barback/lib/src/transformer/base_transform.dart
@@ -49,7 +49,10 @@ abstract class BaseTransform {
// If the log isn't already associated with an asset, use the primary.
if (asset == null) asset = _node.info.primaryId;
var entry = new LogEntry(_node.info, asset, level, message, span);
- _onLogController.add(entry);
+
+ // The log controller can be closed while log entries are still coming in
+ // if the transformer is removed during [apply].
+ if (!_onLogController.isClosed) _onLogController.add(entry);
});
}
« no previous file with comments | « pkg/barback/CHANGELOG.md ('k') | pkg/barback/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698