[Mesa-dev] [PATCH 07/13] mesa/main: Don't free unallocated vertex array state

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Tue May 5 04:25:23 PDT 2015


Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 src/mesa/main/varray.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 42e7f89..b65e6ef 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -1978,6 +1978,8 @@ delete_arrayobj_cb(GLuint id, void *data, void *userData)
 void 
 _mesa_free_varray_data(struct gl_context *ctx)
 {
-   _mesa_HashDeleteAll(ctx->Array.Objects, delete_arrayobj_cb, ctx);
-   _mesa_DeleteHashTable(ctx->Array.Objects);
+   if (ctx->Array.Objects) {
+      _mesa_HashDeleteAll(ctx->Array.Objects, delete_arrayobj_cb, ctx);
+      _mesa_DeleteHashTable(ctx->Array.Objects);
+   }
 }
-- 
1.8.5.1



More information about the mesa-dev mailing list