fix stop process on windows
This commit is contained in:
parent
0d7cab6938
commit
e624110868
@ -1,5 +1,5 @@
|
|||||||
use std::{
|
use std::{
|
||||||
env, fmt,
|
fmt,
|
||||||
process::Child,
|
process::Child,
|
||||||
sync::{
|
sync::{
|
||||||
atomic::{AtomicBool, AtomicUsize, Ordering},
|
atomic::{AtomicBool, AtomicUsize, Ordering},
|
||||||
@ -74,11 +74,13 @@ impl ProcessControl {
|
|||||||
match unit {
|
match unit {
|
||||||
Decoder => {
|
Decoder => {
|
||||||
if let Some(proc) = self.decoder_term.lock().unwrap().as_mut() {
|
if let Some(proc) = self.decoder_term.lock().unwrap().as_mut() {
|
||||||
if env::consts::OS != "windows" {
|
#[cfg(not(windows))]
|
||||||
if let Err(e) = proc.term() {
|
if let Err(e) = proc.term() {
|
||||||
return Err(format!("Decoder {e:?}"));
|
return Err(format!("Decoder {e:?}"));
|
||||||
}
|
}
|
||||||
} else if let Err(e) = proc.kill() {
|
|
||||||
|
#[cfg(windows)]
|
||||||
|
if let Err(e) = proc.kill() {
|
||||||
return Err(format!("Decoder {e:?}"));
|
return Err(format!("Decoder {e:?}"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user