main: create_buffers unlocks mutex when throwing OUT_OF_MEMORY.
authorLaura Ekstrand <laura@jlekstrand.net>
Wed, 1 Apr 2015 18:18:32 +0000 (11:18 -0700)
committerLaura Ekstrand <laura@jlekstrand.net>
Wed, 1 Apr 2015 19:07:28 +0000 (12:07 -0700)
Ilia Mirkin found that I had forgotten to free the mutex in the error case.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/mesa/main/bufferobj.c

index c45cec4..66dee68 100644 (file)
@@ -1333,6 +1333,7 @@ create_buffers(GLsizei n, GLuint *buffers, bool dsa)
          buf = ctx->Driver.NewBufferObject(ctx, buffers[i]);
          if (!buf) {
             _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", func);
+            mtx_unlock(&ctx->Shared->Mutex);
             return;
          }
       }