Merge pull request #116 from eero-thia/thia/close

aya: close file descriptors on Map drop.
pull/115/head
Alessandro Decina 3 years ago committed by GitHub
commit 98b36b23bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -232,6 +232,15 @@ impl Map {
}
}
impl Drop for Map {
fn drop(&mut self) {
// TODO: Replace this with an OwnedFd once that is stabilized.
if let Some(fd) = self.fd.take() {
unsafe { libc::close(fd) };
}
}
}
pub(crate) trait IterableMap<K: Pod, V> {
fn map(&self) -> &Map;

Loading…
Cancel
Save