summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--alacritty/src/renderer/mod.rs18
-rw-r--r--alacritty/src/renderer/rects.rs9
2 files changed, 27 insertions, 0 deletions
diff --git a/alacritty/src/renderer/mod.rs b/alacritty/src/renderer/mod.rs
index d4cee1a1..4d752463 100644
--- a/alacritty/src/renderer/mod.rs
+++ b/alacritty/src/renderer/mod.rs
@@ -754,6 +754,16 @@ impl QuadRenderer {
}
}
+impl Drop for QuadRenderer {
+ fn drop(&mut self) {
+ unsafe {
+ gl::DeleteBuffers(1, &self.vbo_instance);
+ gl::DeleteBuffers(1, &self.ebo);
+ gl::DeleteVertexArrays(1, &self.vao);
+ }
+ }
+}
+
impl<'a> RenderApi<'a> {
pub fn clear(&self, color: Rgb) {
unsafe {
@@ -1402,3 +1412,11 @@ impl Atlas {
Ok(())
}
}
+
+impl Drop for Atlas {
+ fn drop(&mut self) {
+ unsafe {
+ gl::DeleteTextures(1, &self.id);
+ }
+ }
+}
diff --git a/alacritty/src/renderer/rects.rs b/alacritty/src/renderer/rects.rs
index 80886c95..fd966d27 100644
--- a/alacritty/src/renderer/rects.rs
+++ b/alacritty/src/renderer/rects.rs
@@ -344,6 +344,15 @@ impl RectRenderer {
}
}
+impl Drop for RectRenderer {
+ fn drop(&mut self) {
+ unsafe {
+ gl::DeleteBuffers(1, &self.vbo);
+ gl::DeleteVertexArrays(1, &self.vao);
+ }
+ }
+}
+
/// Rectangle drawing program.
#[derive(Debug)]
pub struct RectShaderProgram {