pipedconsole/console/
drop.rs

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