1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#[cfg(windows)]
use winapi::um::handleapi::CloseHandle;
/// Closes the handle to the pipe.
/// When the handle is closed, the worker
/// process will automaticly exit.
#[cfg(not(windows))]
impl Drop for super::Console {
fn drop(&mut self) { }
}
#[cfg(windows)]
/// Closes the handle to the pipe.
/// When the handle is closed, the worker
/// process will automaticly exit.
impl Drop for super::Console {
fn drop(&mut self) { unsafe {
CloseHandle(self.pipe);
} }
}