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

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Fri Nov 28 03:25:06 PST 2014


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 932359c..a0ab1b4 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -792,6 +792,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