Implement Drop for Stream
This commit is contained in:
parent
0541bf8667
commit
7765e941ed
|
@ -148,12 +148,17 @@ impl EventLoop {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Drop for EventLoop {
|
impl Drop for Stream {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
handleapi::CloseHandle(self.pending_scheduled_event);
|
handleapi::CloseHandle(self.pending_scheduled_event);
|
||||||
}
|
}
|
||||||
|
unsafe {
|
||||||
|
let result = synchapi::SetEvent(self.pending_scheduled_event);
|
||||||
|
assert!(result != 0);
|
||||||
|
}
|
||||||
|
self.thread.take().unwrap().join().unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue