From 05e6d4c401f24b5a514da37215c56a33049ff33a Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Tue, 10 Dec 2019 23:36:59 +1000 Subject: [PATCH] GPU/OpenGL: Clean up VAOs at shutdown time These were leaking before. --- src/core/gpu_hw_opengl.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/gpu_hw_opengl.cpp b/src/core/gpu_hw_opengl.cpp index f293f6120..e8e71bfb0 100644 --- a/src/core/gpu_hw_opengl.cpp +++ b/src/core/gpu_hw_opengl.cpp @@ -11,7 +11,14 @@ GPU_HW_OpenGL::GPU_HW_OpenGL() : GPU_HW() {} GPU_HW_OpenGL::~GPU_HW_OpenGL() { - // TODO: Destroy objects... + // Destroy objects which don't have destructors to clean them up + if (m_vao_id != 0) + glDeleteVertexArrays(1, &m_vao_id); + if (m_attributeless_vao_id != 0) + glDeleteVertexArrays(1, &m_attributeless_vao_id); + if (m_texture_buffer_r16ui_texture != 0) + glDeleteTextures(1, &m_texture_buffer_r16ui_texture); + if (m_host_display) { m_host_display->SetDisplayTexture(nullptr, 0, 0, 0, 0, 0, 0, 1.0f);