GPU/OpenGL: Clean up VAOs at shutdown time

These were leaking before.
This commit is contained in:
Connor McLaughlin 2019-12-10 23:36:59 +10:00
parent 152b56c8cc
commit 05e6d4c401

View file

@ -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);