Merge pull request #496 from SergejJurecko/master

fix panic on windows if device gets unplugged
This commit is contained in:
est31 2020-11-08 15:00:21 +01:00 • committed by GitHub
commit 36cf061575
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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);