From d4f8426ae47f88182987dbcc7d6b62cefa5b9682 Mon Sep 17 00:00:00 2001 From: Quantum Date: Sat, 17 Jul 2021 21:40:30 -0400 Subject: [PATCH] [client] egl: correctly clean up vertex buffer objects The code used to use hasBuffer, which was never set to true, so buffer objects were always leaked instead. --- client/renderers/EGL/model.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/renderers/EGL/model.c b/client/renderers/EGL/model.c index 09112609..4d2b2292 100644 --- a/client/renderers/EGL/model.c +++ b/client/renderers/EGL/model.c @@ -37,7 +37,6 @@ struct EGL_Model size_t vertexCount; bool finish; - bool hasBuffer; GLuint buffer; EGL_Shader * shader; @@ -83,7 +82,7 @@ void egl_model_free(EGL_Model ** model) } ll_free((*model)->verticies); - if ((*model)->hasBuffer) + if ((*model)->buffer) glDeleteBuffers(1, &(*model)->buffer); free(*model); @@ -137,7 +136,7 @@ void egl_model_render(EGL_Model * model) if (model->rebuild) { - if (model->hasBuffer) + if (model->buffer) glDeleteBuffers(1, &model->buffer); /* create a buffer large enough */