Actually free buffer objects
With the refactoring to centralize code into CoglBuffer, _cogl_buffer_fini() was never actually implemented, so all GL vertex and index buffer objects were leaked. The duplicate call to glDeleteBuffers() in CoglPixelArray is removed (it wasn't paying attention to whether the buffer had been allocated as a PBO or not.) http://bugzilla.clutter-project.org/show_bug.cgi?id=2423
This commit is contained in:
parent
460e4b90d3
commit
fae591b168
@ -299,8 +299,15 @@ _cogl_buffer_initialize (CoglBuffer *buffer,
|
|||||||
void
|
void
|
||||||
_cogl_buffer_fini (CoglBuffer *buffer)
|
_cogl_buffer_fini (CoglBuffer *buffer)
|
||||||
{
|
{
|
||||||
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
g_return_if_fail (!(buffer->flags & COGL_BUFFER_FLAG_MAPPED));
|
g_return_if_fail (!(buffer->flags & COGL_BUFFER_FLAG_MAPPED));
|
||||||
g_return_if_fail (buffer->immutable_ref == 0);
|
g_return_if_fail (buffer->immutable_ref == 0);
|
||||||
|
|
||||||
|
if (buffer->flags & COGL_BUFFER_FLAG_BUFFER_OBJECT)
|
||||||
|
GE( glDeleteBuffers (1, &buffer->gl_handle) );
|
||||||
|
else
|
||||||
|
g_free (buffer->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* OpenGL ES 1.1 and 2 have a GL_OES_mapbuffer extension that is able to map
|
/* OpenGL ES 1.1 and 2 have a GL_OES_mapbuffer extension that is able to map
|
||||||
|
@ -147,8 +147,6 @@ _cogl_pixel_array_free (CoglPixelArray *buffer)
|
|||||||
/* parent's destructor */
|
/* parent's destructor */
|
||||||
_cogl_buffer_fini (COGL_BUFFER (buffer));
|
_cogl_buffer_fini (COGL_BUFFER (buffer));
|
||||||
|
|
||||||
GE( glDeleteBuffers (1, &(COGL_BUFFER (buffer)->gl_handle)) );
|
|
||||||
|
|
||||||
g_slice_free (CoglPixelArray, buffer);
|
g_slice_free (CoglPixelArray, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user