cogl-buffer: consider it an error to free a mapped buffer

Explicitly warn if we detect that a CoglBuffer is being freed while it
is still mapped. Previously we silently unmapped the buffer, but it's
not something we want to encourage.
This commit is contained in:
Robert Bragg
2010-07-05 23:32:55 +01:00
parent e98ee6665b
commit f8d58446a8
2 changed files with 3 additions and 3 deletions

View File

@ -132,8 +132,7 @@ _cogl_buffer_initialize (CoglBuffer *buffer,
void
_cogl_buffer_fini (CoglBuffer *buffer)
{
if (COGL_BUFFER_FLAG_IS_SET (buffer, MAPPED))
cogl_buffer_unmap (buffer);
g_return_if_fail (!COGL_BUFFER_FLAG_IS_SET (buffer, MAPPED));
}
GLenum