Closed YgorSouza closed 8 months ago
Fixes a use-after-free bug when dropping the HidDevice from a thread other than the one that was last used to read it, because of a pending async operation that did not get canceled.
If the cancellation does not return an error, we get the overlapped result to block until it actually goes through. This is recommended by Microsoft in this example: https://learn.microsoft.com/en-us/windows/win32/fileio/canceling-pending-i-o-operations#canceling-asynchronous-io.
Closes #151
Thanks for fixing this, will release a new version to crates.io.
Fixes a use-after-free bug when dropping the HidDevice from a thread other than the one that was last used to read it, because of a pending async operation that did not get canceled.
If the cancellation does not return an error, we get the overlapped result to block until it actually goes through. This is recommended by Microsoft in this example: https://learn.microsoft.com/en-us/windows/win32/fileio/canceling-pending-i-o-operations#canceling-asynchronous-io.
Closes #151