mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-10 23:07:04 +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;
|
size_t vertexCount;
|
||||||
bool finish;
|
bool finish;
|
||||||
|
|
||||||
bool hasBuffer;
|
|
||||||
GLuint buffer;
|
GLuint buffer;
|
||||||
|
|
||||||
EGL_Shader * shader;
|
EGL_Shader * shader;
|
||||||
@ -83,7 +82,7 @@ void egl_model_free(EGL_Model ** model)
|
|||||||
}
|
}
|
||||||
ll_free((*model)->verticies);
|
ll_free((*model)->verticies);
|
||||||
|
|
||||||
if ((*model)->hasBuffer)
|
if ((*model)->buffer)
|
||||||
glDeleteBuffers(1, &(*model)->buffer);
|
glDeleteBuffers(1, &(*model)->buffer);
|
||||||
|
|
||||||
free(*model);
|
free(*model);
|
||||||
@ -137,7 +136,7 @@ void egl_model_render(EGL_Model * model)
|
|||||||
|
|
||||||
if (model->rebuild)
|
if (model->rebuild)
|
||||||
{
|
{
|
||||||
if (model->hasBuffer)
|
if (model->buffer)
|
||||||
glDeleteBuffers(1, &model->buffer);
|
glDeleteBuffers(1, &model->buffer);
|
||||||
|
|
||||||
/* create a buffer large enough */
|
/* create a buffer large enough */
|
||||||
|
Loading…
Reference in New Issue
Block a user