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
void
_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->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
/* parent's destructor */
_cogl_buffer_fini (COGL_BUFFER (buffer));
- GE( glDeleteBuffers (1, &(COGL_BUFFER (buffer)->gl_handle)) );
-
g_slice_free (CoglPixelArray, buffer);
}