Version 2.12.0-8.0.dev

Merge commit 'da133e5047e0fb447af20cd142fc0cf8363487e6' into 'dev'
diff --git a/sdk/lib/_internal/vm/bin/file_patch.dart b/sdk/lib/_internal/vm/bin/file_patch.dart
index b243920..43fb061 100644
--- a/sdk/lib/_internal/vm/bin/file_patch.dart
+++ b/sdk/lib/_internal/vm/bin/file_patch.dart
@@ -174,9 +174,17 @@
       assert(watcherPath.count > 0);
       watcherPath.count--;
       if (watcherPath.count == 0) {
-        _unwatchPath(_id!, watcherPath.pathId);
-        _pathWatchedEnd();
-        _idMap.remove(watcherPath.pathId);
+        var pathId = watcherPath.pathId;
+        // DirectoryWatchHandle(aka pathId) might be closed already initiated
+        // by issueReadEvent for example. When that happens, appropriate closeEvent
+        // will arrive to us and we will remove this pathId from _idMap. If that
+        // happens we should not try to close it again as pathId is no
+        // longer usable(the memory it points to might be released)
+        if (_idMap.containsKey(pathId)) {
+          _unwatchPath(_id!, pathId);
+          _pathWatchedEnd();
+          _idMap.remove(pathId);
+        }
       }
       _watcherPath = null;
     }
diff --git a/tools/VERSION b/tools/VERSION
index dcc999f..072fa48 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
 MAJOR 2
 MINOR 12
 PATCH 0
-PRERELEASE 7
+PRERELEASE 8
 PRERELEASE_PATCH 0
\ No newline at end of file