mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-18 18:48:10 +00:00
[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.
This commit is contained in:
parent
ad974cfa0a
commit
d4f8426ae4
1 changed files with 2 additions and 3 deletions
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue