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);
}
{
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;
}
#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R600) /* +r6/r7 */
if (IS_R600_CLASS(screen))
{
- r600DestroyContext(driContextPriv);
+ r600DestroyContext(driContextPriv);
}
#endif
rcommonDestroyCmdBuf(radeon);
+#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R600) /* +r6/r7 */
+ if (!IS_R600_CLASS(screen))
+#endif
radeon_destroy_atom_list(radeon);
if (radeon->state.scissor.pClipRects) {