1
0
Fork 0
forked from wry/wry

async: don't leak AsyncFdData

This commit is contained in:
Julian Orth 2022-05-09 15:27:00 +02:00
parent d52dc5f6e9
commit c8068ee2e7

View file

@ -755,12 +755,6 @@ mod fd {
}
}
impl Drop for AsyncFdData {
fn drop(&mut self) {
let _ = self.el.remove(self.id);
}
}
pub struct AsyncFd {
pub(super) engine: Rc<AsyncEngine>,
pub(super) data: Rc<AsyncFdData>,
@ -786,6 +780,7 @@ mod fd {
fn drop(&mut self) {
if self.data.ref_count.fetch_sub(1) == 1 {
self.engine.fds.remove(&self.data.fd.raw());
let _ = self.data.el.remove(self.data.id);
}
}
}