Correctly remove dynamic tiles if not committing a text renderer

This commit is contained in:
Gwilym Kuiper 2022-04-07 23:07:58 +01:00
parent dc4ccee451
commit d56e4d5888

View file

@ -161,3 +161,13 @@ impl<'a> TextRenderer<'a> {
}
}
}
impl<'a> Drop for TextRenderer<'a> {
fn drop(&mut self) {
let tiles = core::mem::take(&mut self.tiles);
for (_, tile) in tiles.into_iter() {
self.vram_manager.remove_dynamic_tile(tile);
}
}
}