[Mesa-dev] [PATCH 06/13] mesa/main: Don't free QueryObjects which were never allocated

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


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

diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index fbccf3f..3adea35 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -999,6 +999,8 @@ delete_queryobj_cb(GLuint id, void *data, void *userData)
 void
 _mesa_free_queryobj_data(struct gl_context *ctx)
 {
-   _mesa_HashDeleteAll(ctx->Query.QueryObjects, delete_queryobj_cb, ctx);
-   _mesa_DeleteHashTable(ctx->Query.QueryObjects);
+   if (ctx->Query.QueryObjects) {
+      _mesa_HashDeleteAll(ctx->Query.QueryObjects, delete_queryobj_cb, ctx);
+      _mesa_DeleteHashTable(ctx->Query.QueryObjects);
+   }
 }
-- 
1.8.5.1



More information about the mesa-dev mailing list