Skip to content

Commit 9966fd1

Browse files
committed
impl Drop for RawTimer
1 parent 73ad341 commit 9966fd1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/timer/async_tokio1.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ impl crate::std::os::unix::io::AsRawFd for RawTimer {
2424
}
2525
}
2626

27+
impl Drop for RawTimer {
28+
fn drop(&mut self) {
29+
unsafe {
30+
libc::close(self.0)
31+
}
32+
}
33+
}
34+
2735
#[cfg(target_os = "android")]
2836
mod sys {
2937
#[repr(C)]

0 commit comments

Comments
 (0)