diff options
Diffstat (limited to 'src/mesa/drivers/dri/r600')
-rw-r--r-- | src/mesa/drivers/dri/r600/r600_context.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r600/r600_emit.c | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index e6c03ecfd5..5be486b176 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -453,9 +453,10 @@ void r600DestroyContext (__DRIcontextPrivate * driContextPriv) { GET_CURRENT_CONTEXT (ctx); - context_t *context = R700_CONTEXT(ctx); + context_t *context = ctx ? R700_CONTEXT(ctx) : NULL; - (context->chipobj.DestroyChipObj)(context->chipobj.pvChipObj); + if (context) + (context->chipobj.DestroyChipObj)(context->chipobj.pvChipObj); } diff --git a/src/mesa/drivers/dri/r600/r600_emit.c b/src/mesa/drivers/dri/r600/r600_emit.c index dee4cd3435..e4ba656ee8 100644 --- a/src/mesa/drivers/dri/r600/r600_emit.c +++ b/src/mesa/drivers/dri/r600/r600_emit.c @@ -234,8 +234,10 @@ GLboolean r600DeleteShader(GLcontext * ctx, { struct radeon_bo * pbo = (struct radeon_bo *)shaderbo; - radeon_bo_unmap(pbo); - radeon_bo_unref(pbo); /* when bo->cref <= 0, bo will be bo_free */ + if (pbo) { + radeon_bo_unmap(pbo); + radeon_bo_unref(pbo); /* when bo->cref <= 0, bo will be bo_free */ + } return GL_TRUE; } |