Skip to content

Commit 5acb5fc

Browse files
author
Dart CI
committed
Version 2.12.0-8.0.dev
Merge commit 'da133e5047e0fb447af20cd142fc0cf8363487e6' into 'dev'
2 parents 03af569 + da133e5 commit 5acb5fc

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

sdk/lib/_internal/vm/bin/file_patch.dart

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,17 @@ abstract class _FileSystemWatcher {
174174
assert(watcherPath.count > 0);
175175
watcherPath.count--;
176176
if (watcherPath.count == 0) {
177-
_unwatchPath(_id!, watcherPath.pathId);
178-
_pathWatchedEnd();
179-
_idMap.remove(watcherPath.pathId);
177+
var pathId = watcherPath.pathId;
178+
// DirectoryWatchHandle(aka pathId) might be closed already initiated
179+
// by issueReadEvent for example. When that happens, appropriate closeEvent
180+
// will arrive to us and we will remove this pathId from _idMap. If that
181+
// happens we should not try to close it again as pathId is no
182+
// longer usable(the memory it points to might be released)
183+
if (_idMap.containsKey(pathId)) {
184+
_unwatchPath(_id!, pathId);
185+
_pathWatchedEnd();
186+
_idMap.remove(pathId);
187+
}
180188
}
181189
_watcherPath = null;
182190
}

tools/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ CHANNEL dev
2727
MAJOR 2
2828
MINOR 12
2929
PATCH 0
30-
PRERELEASE 7
30+
PRERELEASE 8
3131
PRERELEASE_PATCH 0

0 commit comments

Comments
 (0)