Shut down DevTools and DDS processes if flutter_tools is killed by a signal (#159238)
See https://github.com/flutter/flutter/issues/159154
This commit is contained in:
@@ -69,7 +69,6 @@ class FlutterResidentDevtoolsHandler implements ResidentDevtoolsHandler {
|
||||
final ResidentRunner _residentRunner;
|
||||
final Logger _logger;
|
||||
bool _shutdown = false;
|
||||
bool _served = false;
|
||||
|
||||
@visibleForTesting
|
||||
bool launchedInBrowser = false;
|
||||
@@ -105,7 +104,6 @@ class FlutterResidentDevtoolsHandler implements ResidentDevtoolsHandler {
|
||||
_devToolsLauncher.devToolsUrl = devToolsServerAddress;
|
||||
} else {
|
||||
await _devToolsLauncher.serve();
|
||||
_served = true;
|
||||
}
|
||||
await _devToolsLauncher.ready;
|
||||
// Do not attempt to print debugger list if the connection has failed or if we're shutting down.
|
||||
@@ -305,7 +303,7 @@ class FlutterResidentDevtoolsHandler implements ResidentDevtoolsHandler {
|
||||
@override
|
||||
Future<void> shutdown() async {
|
||||
_shutdown = true;
|
||||
if (_devToolsLauncher == null || !_served) {
|
||||
if (_devToolsLauncher == null) {
|
||||
return;
|
||||
}
|
||||
_readyToAnnounce = false;
|
||||
|
||||
@@ -1248,8 +1248,10 @@ class HotRunner extends ResidentRunner {
|
||||
|
||||
@override
|
||||
Future<void> cleanupAfterSignal() async {
|
||||
await residentDevtoolsHandler!.shutdown();
|
||||
await stopEchoingDeviceLog();
|
||||
await hotRunnerConfig!.runPreShutdownOperations();
|
||||
shutdownDartDevelopmentService();
|
||||
if (stopAppDuringCleanup) {
|
||||
return exitApp();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user