This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -360,21 +360,28 @@ impl FlycheckActor {
360360 }
361361}
362362
363- struct JodChild ( GroupChild ) ;
363+ struct JodGroupChild ( GroupChild ) ;
364+
365+ impl Drop for JodGroupChild {
366+ fn drop ( & mut self ) {
367+ _ = self . 0 . kill ( ) ;
368+ _ = self . 0 . wait ( ) ;
369+ }
370+ }
364371
365372/// A handle to a cargo process used for fly-checking.
366373struct CargoHandle {
367374 /// The handle to the actual cargo process. As we cannot cancel directly from with
368375 /// a read syscall dropping and therefore terminating the process is our best option.
369- child : JodChild ,
376+ child : JodGroupChild ,
370377 thread : jod_thread:: JoinHandle < io:: Result < ( bool , String ) > > ,
371378 receiver : Receiver < CargoMessage > ,
372379}
373380
374381impl CargoHandle {
375382 fn spawn ( mut command : Command ) -> std:: io:: Result < CargoHandle > {
376383 command. stdout ( Stdio :: piped ( ) ) . stderr ( Stdio :: piped ( ) ) . stdin ( Stdio :: null ( ) ) ;
377- let mut child = command. group_spawn ( ) . map ( JodChild ) ?;
384+ let mut child = command. group_spawn ( ) . map ( JodGroupChild ) ?;
378385
379386 let stdout = child. 0 . inner ( ) . stdout . take ( ) . unwrap ( ) ;
380387 let stderr = child. 0 . inner ( ) . stderr . take ( ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments