mac: stop leaking ssh processes on quit

This commit is contained in:
Peter Steinberger
2025-12-09 02:50:40 +00:00
parent 7aefcab8b0
commit e7cdac90f5
3 changed files with 32 additions and 3 deletions

View File

@@ -234,9 +234,15 @@ actor AgentRPC {
}
}
func shutdown() async {
await self.stop()
}
private func stop() async {
self.stdoutHandle?.readabilityHandler = nil
self.process?.terminate()
let proc = self.process
proc?.terminate()
proc?.waitUntilExit()
self.process = nil
self.stdinHandle = nil
self.stdoutHandle = nil