[Mesa-dev] [PATCH 04/13] mesa/main: Don't go freeing pipeline data which is not reserved

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


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

diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c
index b713d95..c17ce1a 100644
--- a/src/mesa/main/pipelineobj.c
+++ b/src/mesa/main/pipelineobj.c
@@ -122,10 +122,13 @@ _mesa_free_pipeline_data(struct gl_context *ctx)
 {
    _mesa_reference_pipeline_object(ctx, &ctx->_Shader, NULL);
 
-   _mesa_HashDeleteAll(ctx->Pipeline.Objects, delete_pipelineobj_cb, ctx);
-   _mesa_DeleteHashTable(ctx->Pipeline.Objects);
+   if (ctx->Pipeline.Objects) {
+      _mesa_HashDeleteAll(ctx->Pipeline.Objects, delete_pipelineobj_cb, ctx);
+      _mesa_DeleteHashTable(ctx->Pipeline.Objects);
+   }
 
-   _mesa_delete_pipeline_object(ctx, ctx->Pipeline.Default);
+   if (ctx->Pipeline.Default)
+      _mesa_delete_pipeline_object(ctx, ctx->Pipeline.Default);
 }
 
 /**
-- 
1.8.5.1



More information about the mesa-dev mailing list