Skip to content

Commit

Permalink
impl Drop for RawTimer
Browse files Browse the repository at this point in the history
  • Loading branch information
DoumanAsh committed Sep 29, 2024
1 parent 73ad341 commit 9966fd1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/timer/async_tokio1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ impl crate::std::os::unix::io::AsRawFd for RawTimer {
}
}

impl Drop for RawTimer {
fn drop(&mut self) {
unsafe {
libc::close(self.0)
}
}
}

#[cfg(target_os = "android")]
mod sys {
#[repr(C)]
Expand Down

0 comments on commit 9966fd1

Please sign in to comment.