[ISSUE-30478] Release cache dir lock acquired by a command on sigint or sigterm (#52194)

This commit is contained in:
Dmitry Ratushnyy
2020-03-13 01:11:01 +09:00
committed by GitHub
parent 04a1b78b75
commit 1b0fd265bd
2 changed files with 38 additions and 0 deletions

View File

@@ -622,6 +622,7 @@ abstract class FlutterCommand extends Command<void> {
void _registerSignalHandlers(String commandPath, DateTime startTime) {
final SignalHandler handler = (io.ProcessSignal s) {
Cache.releaseLockEarly();
_sendPostUsage(
commandPath,
const FlutterCommandResult(ExitStatus.killed),