>> Which method do you prefer? Should remove the following If (batch->buffer != NULL) { dri_bo_unreference(batch->buffer); batch->buffer = NULL); } That code is duplicated. And dri_bo_unreference looks more consistant. Thanks Zou Nanhai