Skip to content

Commit 2a8269b

Browse files
author
Ryan Gordon
committed
Deallocate VAO and VBO in viewer.cpp so that memory doesn't leak within the GL library
1 parent 045e12b commit 2a8269b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

examples/viewer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ bool Viewer::render()
225225
glDrawArrays(GL_TRIANGLES, 0, 6);
226226
ir.deallocate();
227227
}
228+
229+
gl()->glDeleteBuffers(1, &triangle_vbo);
230+
gl()->glDeleteVertexArrays(1, &triangle_vao);
228231
}
229232

230233
// put the stuff we've been drawing onto the display

0 commit comments

Comments
 (0)