From 9966fd1cc143fb1727f702449de6ba58672f2d09 Mon Sep 17 00:00:00 2001 From: DoumanAsh Date: Sun, 29 Sep 2024 09:23:13 +0900 Subject: [PATCH] impl Drop for RawTimer --- src/timer/async_tokio1.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/timer/async_tokio1.rs b/src/timer/async_tokio1.rs index f469c42..6b4914a 100644 --- a/src/timer/async_tokio1.rs +++ b/src/timer/async_tokio1.rs @@ -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)]