Skip to content

Commit

Permalink
Make sure everything gets dropped
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Sep 30, 2024
1 parent 9a8b091 commit 884dc31
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion esp-hal/src/spi/master.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,12 @@ mod dma {
fn drop(&mut self) {
if !self.is_done() {
self.spi_dma.cancel_transfer();
self.spi_dma.wait_for_idle()
self.spi_dma.wait_for_idle();

unsafe {
ManuallyDrop::drop(&mut self.spi_dma);
ManuallyDrop::drop(&mut self.dma_buf);
}
}
}
}
Expand Down

0 comments on commit 884dc31

Please sign in to comment.