summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-07-20 11:52:58 +0200
committerSamuel Pitoiset <[email protected]>2017-07-20 16:14:24 +0200
commitea13aa853053ffafb0fc13e2df5b66af7b924a7c (patch)
treed897128a772125fa92caa6c65ef32907b25b5bd7 /src/mesa
parent1c6c42c289702d29f14c2512bbadc97a3a1fc520 (diff)
mesa: tidy up _mesa_DeleteVertexArrays()
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/arrayobj.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index 17a789f4da4..ce0050ace33 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -493,19 +493,18 @@ _mesa_DeleteVertexArrays(GLsizei n, const GLuint *ids)
for (i = 0; i < n; i++) {
struct gl_vertex_array_object *obj = _mesa_lookup_vao(ctx, ids[i]);
- if ( obj != NULL ) {
- assert( obj->Name == ids[i] );
-
- /* If the array object is currently bound, the spec says "the binding
- * for that object reverts to zero and the default vertex array
- * becomes current."
- */
- if ( obj == ctx->Array.VAO ) {
- _mesa_BindVertexArray(0);
- }
-
- /* The ID is immediately freed for re-use */
- remove_array_object(ctx, obj);
+ if (obj) {
+ assert(obj->Name == ids[i]);
+
+ /* If the array object is currently bound, the spec says "the binding
+ * for that object reverts to zero and the default vertex array
+ * becomes current."
+ */
+ if (obj == ctx->Array.VAO)
+ _mesa_BindVertexArray(0);
+
+ /* The ID is immediately freed for re-use */
+ remove_array_object(ctx, obj);
if (ctx->Array.LastLookedUpVAO == obj)
_mesa_reference_vao(ctx, &ctx->Array.LastLookedUpVAO, NULL);