Unpause and remove breakpoints when detaching from Flutter process with DAP (#101695)

This commit is contained in:
Danny Tuppeny
2022-04-11 21:15:37 +01:00
committed by GitHub
parent b086473769
commit 675b961573
3 changed files with 40 additions and 6 deletions

View File

@@ -205,6 +205,9 @@ class FlutterDebugAdapter extends DartDebugAdapter<FlutterLaunchRequestArguments
/// quickly and therefore may leave orphaned processes.
@override
Future<void> disconnectImpl() async {
if (isAttach) {
await preventBreakingAndResume();
}
terminatePids(ProcessSignal.sigkill);
}
@@ -379,6 +382,9 @@ class FlutterDebugAdapter extends DartDebugAdapter<FlutterLaunchRequestArguments
/// Called by [terminateRequest] to request that we gracefully shut down the app being run (or in the case of an attach, disconnect).
@override
Future<void> terminateImpl() async {
if (isAttach) {
await preventBreakingAndResume();
}
terminatePids(ProcessSignal.sigterm);
await _process?.exitCode;
}