First of all, I think this project is really great!❤
But I have encountered a little problem in using it.
I have embedded an aria2 downloader in the program using Sidecar. Everything was working fine until I closed the program and found that the aria2 process was still alive.
How should I deal with this problem?
I solved it in the following way for now. But I think it is the wrong way.
pub struct MyCommandChild {
pub inner: Arc<SharedChild>,
pub stdin_writer: PipeWriter,
}
thread::spawn(move || {
let child = spawn_aria2c_server();
let my_child: MyCommandChild = unsafe {
std::mem::transmute(child)
};
let sc = my_child.inner;
window.on_window_event(move |event|
match event {
WindowEvent::Destroyed =>{match sc.kill(){
Ok(_) => {println!("shutdown aria2 server success")}
Err(_) => {eprintln!("shutdown aria2 server failed,please close by self")}
};}
_ => {}
}
)
});
First of all, I think this project is really great!❤
But I have encountered a little problem in using it.
I have embedded an aria2 downloader in the program using Sidecar. Everything was working fine until I closed the program and found that the aria2 process was still alive.
How should I deal with this problem?
I solved it in the following way for now. But I think it is the wrong way.