fix panic on windows if device gets unplugged

This commit is contained in:
Sergej Jurečko 2020-11-05 09:24:00 +01:00
parent 2220f58491
commit 3d163c3468

View file

@ -141,8 +141,8 @@ impl Stream {
#[inline] #[inline]
fn push_command(&self, command: Command) { fn push_command(&self, command: Command) {
// Safe to unwrap: sender outlives receiver. // Sender generally outlives receiver, unless the device gets unplugged.
self.commands.send(command).unwrap(); let _ = self.commands.send(command);
unsafe { unsafe {
let result = synchapi::SetEvent(self.pending_scheduled_event); let result = synchapi::SetEvent(self.pending_scheduled_event);
assert_ne!(result, 0); assert_ne!(result, 0);