r300g: fix invalid dereference in winsys

radeon_bo_unref may destroy the buffer, so call it after p_atomic_dec, not before.
This commit is contained in:
Marek Olšák 2011-02-19 00:06:52 +01:00
parent e16e70610c
commit e9e5380f22
1 changed files with 1 additions and 1 deletions

View File

@ -110,8 +110,8 @@ static void radeon_cs_context_cleanup(struct radeon_cs_context *csc)
unsigned i;
for (i = 0; i < csc->crelocs; i++) {
radeon_bo_unref(csc->relocs_bo[i]);
p_atomic_dec(&csc->relocs_bo[i]->num_cs_references);
radeon_bo_unref(csc->relocs_bo[i]);
csc->relocs_bo[i] = NULL;
}