浏览代码

LibAccelGfx: Deallocate VAO and VBOs in fill_rect_with_linear_gradient

Fixes memory leak in fill_rect_with_linear_gradient()
Aliaksandr Kalenik 1 年之前
父节点
当前提交
9a66f31b64
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      Userland/Libraries/LibAccelGfx/Painter.cpp

+ 4 - 0
Userland/Libraries/LibAccelGfx/Painter.cpp

@@ -537,6 +537,10 @@ void Painter::fill_rect_with_linear_gradient(Gfx::FloatRect const& rect, Readonl
 
     GL::enable_blending(GL::BlendFactor::One, GL::BlendFactor::OneMinusSrcAlpha);
     GL::draw_arrays(GL::DrawPrimitive::Triangles, vertices.size() / 2);
+
+    GL::delete_buffer(vbo_vertices);
+    GL::delete_buffer(vbo_colors);
+    GL::delete_vertex_array(vao);
 }
 
 void Painter::save()