mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
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:
parent
e98ee6665b
commit
f8d58446a8
@ -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
|
||||
|
@ -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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user