Index: pkg/barback/lib/src/phase_forwarder.dart |
diff --git a/pkg/barback/lib/src/phase_forwarder.dart b/pkg/barback/lib/src/phase_forwarder.dart |
index b540acdbd5098ed4ba40d05041968f45d2050a28..c1f7abdf76443adeff002eaf27287513102cb9ee 100644 |
--- a/pkg/barback/lib/src/phase_forwarder.dart |
+++ b/pkg/barback/lib/src/phase_forwarder.dart |
@@ -7,7 +7,6 @@ library barback.phase_forwarder; |
import 'dart:async'; |
import 'asset_node.dart'; |
-import 'asset_node_set.dart'; |
/// A class that takes care of forwarding assets within a phase. |
/// |
@@ -41,7 +40,7 @@ class PhaseForwarder { |
int _numChannels; |
/// The intermediate forwarded assets. |
- final _intermediateAssets = new AssetNodeSet(); |
+ final _intermediateAssets = new Set<AssetNode>(); |
/// The final forwarded asset. |
/// |
@@ -70,7 +69,11 @@ class PhaseForwarder { |
} |
_intermediateAssets.add(asset); |
- asset.onStateChange.listen((_) => _adjustOutput()); |
+ |
+ asset.onStateChange.listen((state) { |
+ if (state.isRemoved) _intermediateAssets.remove(asset); |
+ _adjustOutput(); |
+ }); |
_adjustOutput(); |
} |