diff --git a/clutter/cogl/cogl/cogl-buffer.c b/clutter/cogl/cogl/cogl-buffer.c index 1000d74dc..a4e9e66c5 100644 --- a/clutter/cogl/cogl/cogl-buffer.c +++ b/clutter/cogl/cogl/cogl-buffer.c @@ -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 diff --git a/clutter/cogl/cogl/cogl-buffer.h b/clutter/cogl/cogl/cogl-buffer.h index 7c61b51dc..8ad45a233 100644 --- a/clutter/cogl/cogl/cogl-buffer.h +++ b/clutter/cogl/cogl/cogl-buffer.h @@ -191,7 +191,8 @@ typedef enum { /*< prefix=COGL_BUFFER_MAP_HINT >*/ * new buffer to map. * * The behaviour is undefined if you access the buffer in a way - * conflicting with the @access mask you pass. + * conflicting with the @access mask you pass. It is also an error to + * release your last reference while the buffer is mapped. * * Return value: A pointer to the mapped memory or %NULL is the call fails *