Skip to content

Commit

Permalink
fixed gl_set_drawcall_buffer_capacity memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
yui-915 authored and not-fl3 committed Sep 12, 2024
1 parent 8571468 commit 9a343af
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/quad_gl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1000,13 +1000,18 @@ impl QuadGl {
) {
self.max_vertices = max_vertices;
self.max_indices = max_indices;
self.draw_calls_count = 0;

for draw_call in &mut self.draw_calls {
draw_call.vertices =
vec![Vertex::new(0., 0., 0., 0., 0., Color::new(0.0, 0.0, 0.0, 0.0)); max_vertices];
draw_call.indices = vec![0; max_indices];
}
for binding in &mut self.draw_calls_bindings {
ctx.delete_buffer(binding.index_buffer);
for vertex_buffer in &binding.vertex_buffers {
ctx.delete_buffer(*vertex_buffer);
}
let vertex_buffer = ctx.new_buffer(
BufferType::VertexBuffer,
BufferUsage::Stream,
Expand Down

0 comments on commit 9a343af

Please sign in to comment.