Skip to content

Commit 04bd948

Browse files
committed
implement latest from dart-lang/webdev/pull/342
1 parent d4d8ad2 commit 04bd948

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/src/chrome.dart

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,16 @@ class Chrome {
146146
chromeConnection.close();
147147
_process?.kill(ProcessSignal.sigkill);
148148
await _process?.exitCode;
149-
await _dataDir?.delete(recursive: true);
149+
try {
150+
// Chrome starts another process as soon as it dies that modifies the
151+
// profile information. Give it some time before attempting to delete
152+
// the directory.
153+
await Future.delayed(Duration(milliseconds: 500));
154+
await _dataDir?.delete(recursive: true);
155+
} catch (_) {
156+
// Silently fail if we can't clean up the profile information.
157+
// It is a system tmp directory so it should get cleaned up eventually.
158+
}
150159
}
151160
}
152161

0 commit comments

Comments
 (0)