We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea140c8 commit f0273b6Copy full SHA for f0273b6
src/image/iscache.rs
@@ -16,7 +16,8 @@ use libipt_sys::{
16
pt_iscache_alloc,
17
pt_iscache_name,
18
pt_iscache_read,
19
- pt_iscache_set_limit
+ pt_iscache_set_limit,
20
+ pt_iscache_free
21
};
22
23
#[cfg(test)]
@@ -165,4 +166,10 @@ impl<'a> SectionCache<'a> {
165
166
pub fn set_limit(&mut self, limit: u64) -> Result<(), PtError> {
167
ensure_ptok(unsafe { pt_iscache_set_limit(self.0, limit) })
168
}
169
+}
170
+
171
+impl<'a> Drop for SectionCache<'a> {
172
+ fn drop(&mut self) {
173
+ unsafe { pt_iscache_free(self.0) }
174
+ }
175
0 commit comments