File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -360,21 +360,28 @@ impl FlycheckActor {
360
360
}
361
361
}
362
362
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
+ }
364
371
365
372
/// A handle to a cargo process used for fly-checking.
366
373
struct CargoHandle {
367
374
/// The handle to the actual cargo process. As we cannot cancel directly from with
368
375
/// a read syscall dropping and therefore terminating the process is our best option.
369
- child : JodChild ,
376
+ child : JodGroupChild ,
370
377
thread : jod_thread:: JoinHandle < io:: Result < ( bool , String ) > > ,
371
378
receiver : Receiver < CargoMessage > ,
372
379
}
373
380
374
381
impl CargoHandle {
375
382
fn spawn ( mut command : Command ) -> std:: io:: Result < CargoHandle > {
376
383
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 ) ?;
378
385
379
386
let stdout = child. 0 . inner ( ) . stdout . take ( ) . unwrap ( ) ;
380
387
let stderr = child. 0 . inner ( ) . stderr . take ( ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments