deallocate palettes

This commit is contained in:
Corwin 2023-04-03 02:43:27 +01:00
parent 57f24acdf9
commit 6007b95926
No known key found for this signature in database

View file

@ -81,6 +81,12 @@ struct PaletteVramData {
location: Location, location: Location,
} }
impl Drop for PaletteVramData {
fn drop(&mut self) {
unsafe { PALETTE_ALLOCATOR.dealloc(self.location.as_palette_ptr(), Palette16::layout()) }
}
}
#[derive(Debug)] #[derive(Debug)]
pub struct PaletteVram { pub struct PaletteVram {
data: Rc<PaletteVramData>, data: Rc<PaletteVramData>,