Skip to content

Commit

Permalink
Remove temporary images when dropping kitty resources
Browse files Browse the repository at this point in the history
  • Loading branch information
mfontanini committed Jan 22, 2024
1 parent 04f50cd commit fa40b42
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/media/kitty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ enum KittyBuffer {
Memory(Vec<u8>),
}

impl Drop for KittyBuffer {
fn drop(&mut self) {
if let Self::Filesystem(path) = self {
let _ = fs::remove_file(path);
}
}
}

struct GifFrame<T> {
delay: Delay,
buffer: T,
Expand Down

0 comments on commit fa40b42

Please sign in to comment.