mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-23 05:53:40 +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
@ -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 New Issue
Block a user