[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
Tue May 5 04:25:20 PDT 2015
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 0fefa7d..73a6af8 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