Skip to content

Commit

Permalink
Merge pull request #164 from tonarino/fix-async-pool-memory-leak
Browse files Browse the repository at this point in the history
Fix memory leak on `AsyncTransfer` struct
  • Loading branch information
Y-Nak committed Apr 13, 2023
2 parents 1fad278 + c0cebd1 commit 1023142
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions device/src/u3v/async_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ impl AsyncTransfer {
impl Drop for AsyncTransfer {
fn drop(&mut self) {
unsafe {
drop(Box::from_raw(
self.transfer().user_data.cast::<AtomicBool>(),
));
libusb1_sys::libusb_free_transfer(self.ptr.as_ptr());
}
}
Expand Down

0 comments on commit 1023142

Please sign in to comment.