Index: pkg/watcher/lib/src/directory_watcher/polling.dart |
diff --git a/pkg/watcher/lib/src/directory_watcher/polling.dart b/pkg/watcher/lib/src/directory_watcher/polling.dart |
index e50a0c05c148e1601088f94c074e390b9bed0454..684f7aad8ba21ef665739d0f1184ddb1281ce20f 100644 |
--- a/pkg/watcher/lib/src/directory_watcher/polling.dart |
+++ b/pkg/watcher/lib/src/directory_watcher/polling.dart |
@@ -8,6 +8,7 @@ import 'dart:async'; |
import 'dart:io'; |
import 'package:crypto/crypto.dart'; |
+import 'package:stack_trace/stack_trace.dart'; |
import '../async_queue.dart'; |
import '../stat.dart'; |
@@ -105,7 +106,7 @@ class _PollingDirectoryWatcher implements ManuallyClosedDirectoryWatcher { |
_filesToProcess.add(null); |
} |
- var stream = new Directory(directory).list(recursive: true); |
+ var stream = Chain.track(new Directory(directory).list(recursive: true)); |
_listSubscription = stream.listen((entity) { |
assert(!_events.isClosed); |
@@ -185,7 +186,7 @@ class _PollingDirectoryWatcher implements ManuallyClosedDirectoryWatcher { |
/// Calculates the SHA-1 hash of the file at [path]. |
Future<List<int>> _hashFile(String path) { |
- return new File(path).readAsBytes().then((bytes) { |
+ return Chain.track(new File(path).readAsBytes()).then((bytes) { |
var sha1 = new SHA1(); |
sha1.add(bytes); |
return sha1.close(); |