We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4bb8ef5 commit ba93ef2Copy full SHA for ba93ef2
gix-transport/src/client/blocking_io/file.rs
@@ -126,6 +126,18 @@ impl client::TransportWithoutIO for SpawnProcessOnDemand {
126
}
127
128
129
+impl Drop for SpawnProcessOnDemand {
130
+ fn drop(&mut self) {
131
+ if let Some(mut child) = self.child.take() {
132
+ // The child process (e.g. `ssh`) may still be running at this point, so kill it before joining/waiting.
133
+ // In the happy-path case, it should have already exited gracefully, but in error cases or if the user
134
+ // interrupted the operation, it will likely still be running.
135
+ child.kill().ok();
136
+ child.wait().ok();
137
+ }
138
139
+}
140
+
141
struct ReadStdoutFailOnError {
142
recv: std::sync::mpsc::Receiver<std::io::Error>,
143
read: std::process::ChildStdout,
0 commit comments